-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
1 parent
32b9859
commit 82c5e36
Showing
10 changed files
with
146 additions
and
34 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 |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<script lang="ts"> | ||
import { classNames } from '$libs/util/classNames'; | ||
import { Icon, type IconType } from '../Icon'; | ||
type AlertType = 'success' | 'warning' | 'error' | 'info'; | ||
type AlertTypeDetails = { | ||
class: string; | ||
iconType: IconType; | ||
iconFillClass: string; | ||
}; | ||
export let type: AlertType; | ||
export let forceColumnFlow = false; | ||
let typeMap: Record<AlertType, AlertTypeDetails> = { | ||
success: { | ||
class: 'alert-success', | ||
iconType: 'check-circle', | ||
iconFillClass: 'fill-success-content', | ||
}, | ||
warning: { | ||
class: 'alert-warning', | ||
iconType: 'exclamation-circle', | ||
iconFillClass: 'fill-warning-content', | ||
}, | ||
error: { | ||
class: 'alert-danger', | ||
iconType: 'x-close-circle', | ||
iconFillClass: 'fill-error-content', | ||
}, | ||
info: { | ||
class: 'alert-info', | ||
iconType: 'info-circle', | ||
iconFillClass: 'fill-info-content', | ||
}, | ||
}; | ||
const classes = classNames( | ||
'alert gap-[5px] py-[12px] px-[20px] rounded-[10px]', | ||
type ? typeMap[type].class : null, | ||
forceColumnFlow ? 'grid-flow-col text-left' : null, | ||
$$props.class, | ||
); | ||
const iconType = typeMap[type].iconType; | ||
const iconFillClass = typeMap[type].iconFillClass; | ||
</script> | ||
|
||
<div class={classes}> | ||
<div class="self-start"> | ||
<Icon type={iconType} fillClass={iconFillClass} size={24} /> | ||
</div> | ||
<div class="callout-regular"> | ||
<slot /> | ||
</div> | ||
</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 @@ | ||
export { default as Alert } from './Alert.svelte'; |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,29 @@ | ||
<script> | ||
import { t } from 'svelte-i18n'; | ||
import { Alert } from '$components/Alert'; | ||
import { Button } from '$components/Button'; | ||
import { Card } from '$components/Card'; | ||
import { ChainSelector } from '$components/ChainSelector'; | ||
import { TokenDropdown } from '$components/TokenDropdown'; | ||
import { testERC20Tokens } from '$libs/token'; | ||
</script> | ||
|
||
<Card title={$t('faucet.title')} text={$t('faucet.subtitle')}>TODO: Faucet</Card> | ||
<Card title={$t('faucet.title')} text={$t('faucet.subtitle')}> | ||
<div class="space-y-[35px]"> | ||
<div class="space-y-2"> | ||
<ChainSelector label={$t('faucet.currently_on')} /> | ||
<TokenDropdown tokens={testERC20Tokens} /> | ||
</div> | ||
|
||
<Button type="primary" class="px-[28px] py-[14px]"> | ||
<span class="body-bold">{$t('faucet.mint_button')}</span> | ||
</Button> | ||
|
||
<div class="h-sep" /> | ||
|
||
<Alert type="warning" forceColumnFlow> | ||
{$t('faucet.warning_message')} | ||
</Alert> | ||
</div> | ||
</Card> |
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
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,5 +1,5 @@ | ||
export { default as BllIcon } from './BLL.svelte'; | ||
export { default as EthIcon } from './ETH.svelte'; | ||
export { default as HorseIcon } from './HORSE.svelte'; | ||
export { default as Icon } from './Icon.svelte'; | ||
export { default as Icon, type IconType } from './Icon.svelte'; | ||
export { default as TaikoIcon } from './Taiko.svelte'; |
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