-
Notifications
You must be signed in to change notification settings - Fork 0
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
4 changed files
with
48 additions
and
1 deletion.
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,11 +1,19 @@ | ||
import { CustomButton } from '@/components/Buttons/CustomButton'; | ||
import { Chart } from '@/components/Charts/Chart'; | ||
import container from '@/container'; | ||
import CountryRepository from '@/domain/repositories/CountryRepository'; | ||
|
||
/** | ||
* You can use this page to try and show off your components. | ||
* It's not accessible from the UI, but you can reach it by manually navigating to /elements | ||
*/ | ||
export default async function Elements() { | ||
const countryData = await container.resolve<CountryRepository>('CountryRepository').getCountryData(50); | ||
return <Chart chartData={countryData.fcsGraph} />; | ||
return ( | ||
<div> | ||
<Chart chartData={countryData.fcsGraph} />;<CustomButton variant="solid">Test</CustomButton> | ||
<CustomButton variant="bordered">Test</CustomButton> | ||
<CustomButton variant="flat">Test</CustomButton> | ||
</div> | ||
); | ||
} |
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { Button } from '@nextui-org/button'; | ||
import clsx from 'clsx'; | ||
|
||
import { CustomButtonProps } from '@/domain/props/CustomButtonProps'; | ||
|
||
/** | ||
* Custom button component in the variants solid, bordered and flat. It can be used like a normal NextUI button | ||
* component. | ||
* @param variant solid | bordered | flat | ||
*/ | ||
|
||
export function CustomButton({ children, ...attributes }: CustomButtonProps) { | ||
const { variant } = attributes; | ||
|
||
return ( | ||
<Button | ||
{...attributes} | ||
className={clsx({ | ||
'hover:bg-outlinedHover': variant === 'bordered', | ||
'hover:bg-hover dark:text-foreground': variant === 'flat' || variant === 'solid', | ||
'bg-clickableSecondary hover:text-background ': variant === 'flat', | ||
'bg-primary dark:hover:bg-hover text-background': variant === 'solid', | ||
})} | ||
> | ||
{children} | ||
</Button> | ||
); | ||
} |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { ButtonProps } from '@nextui-org/button'; | ||
|
||
export interface CustomButtonProps extends ButtonProps { | ||
children: React.ReactNode; | ||
} |
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