-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
63 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,44 @@ | ||
const belongOptions = [ | ||
{ value: 'campus', label: '校園活動', ariaLabel: 'Select campus event' }, | ||
{ value: 'club', label: '社團活動', ariaLabel: 'Select club event' }, | ||
// ... other options | ||
]; | ||
|
||
interface BelongContentProps { | ||
onNext: () => void; // 定义 onNext 是一个无参数、无返回值的函数 | ||
} | ||
|
||
export default function BelongContent({onNext}: BelongContentProps) { | ||
return ( | ||
<> | ||
<div></div> | ||
<div className="flex items-center justify-center"> | ||
<div className="flex w-full flex-col"> | ||
<button className="card bg-neutral-content rounded-box grid h-20 place-items-center text-gray-800 font-bold text-2xl mb-8 hover:scale-105 transition-transform" | ||
onClick={onNext} | ||
> | ||
校園活動 | ||
</button> | ||
<button className="card bg-neutral-content rounded-box grid h-20 place-items-center text-gray-800 font-bold text-2xl mb-8 hover:scale-105 transition-transform" | ||
onClick={onNext} | ||
> | ||
社團活動 | ||
</button> | ||
<button className="card bg-neutral-content rounded-box grid h-20 place-items-center text-gray-800 font-bold text-2xl mb-8 hover:scale-105 transition-transform" | ||
onClick={onNext} | ||
> | ||
系上活動 | ||
</button> | ||
<button className="card bg-neutral-content rounded-box grid h-20 place-items-center text-gray-800 font-bold text-2xl mb-8 hover:scale-105 transition-transform" | ||
onClick={onNext} | ||
> | ||
其他 | ||
interface SelectionOption { | ||
value: string; | ||
label: string; | ||
ariaLabel: string; | ||
} | ||
|
||
interface SelectionContentProps { | ||
options: SelectionOption[]; | ||
onSelect: (value: string) => void; | ||
} | ||
|
||
const SelectionContent: React.FC<SelectionContentProps> = ({options, onSelect}) => ( | ||
<> | ||
<div></div> | ||
<div className="flex items-center justify-center"> | ||
<div className="flex w-full flex-col"> | ||
{options.map(({ value, label }) => ( | ||
<button | ||
className="card bg-neutral-content rounded-box grid h-20 place-items-center text-gray-800 font-bold text-2xl mb-8 hover:scale-105 transition-transform" | ||
key={value} | ||
onClick={() => onSelect(value)} | ||
> | ||
{ label } | ||
</button> | ||
</div> | ||
))} | ||
</div> | ||
</> | ||
) | ||
</div> | ||
</> | ||
); | ||
|
||
|
||
export default function BelongContent({onNext}: BelongContentProps) { | ||
return <SelectionContent options={belongOptions} onSelect={onNext} />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters