Skip to content

Commit

Permalink
Attach events to sponsor creation (#153)
Browse files Browse the repository at this point in the history
  • Loading branch information
GAsplund authored Feb 11, 2025
1 parent c1a72c3 commit 6197160
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
16 changes: 9 additions & 7 deletions src/app/[locale]/settings/sponsors/AddSponsorForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,17 @@ const AddSponsorForm = ({ locale }: { locale: string }) => {
</form>
</td>
<td>
<input
type="file"
id="sponsorImage"
accept="image/*"
onChange={handleImageChange}
/>
<form onSubmit={handleSubmit}>
<input
type="file"
id="sponsorImage"
accept="image/*"
onChange={handleImageChange}
/>
</form>
</td>
<td>
<ActionButton>{l.general.add}</ActionButton>
<ActionButton onClick={handleSubmit}>{l.general.add}</ActionButton>
</td>
</tr>
);
Expand Down
7 changes: 6 additions & 1 deletion src/app/[locale]/settings/sponsors/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import ActionLink from '@/components/ActionButton/ActionLink';
import RemoveSponsorButton from './RemoveSponsorButton';
import i18nService from '@/services/i18nService';
import Table from '@/components/Table/Table';
import { SponsorType } from '@prisma/client';

export default async function Page({
params: { locale }
Expand Down Expand Up @@ -34,7 +35,11 @@ export default async function Page({
{sponsors.map((sponsor) => (
<tr key={sponsor.id}>
<td>{sponsor.id}</td>
<td>{sponsor.type}</td>
<td>
{sponsor.type === SponsorType.MAIN_PARTNER
? l.sponsors.main
: l.sponsors.partner}
</td>
<td>{sponsor.nameSv}</td>
<td>
<ActionLink target="_blank" href={sponsor.url}>
Expand Down

0 comments on commit 6197160

Please sign in to comment.