-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update Button component * Preparatory changes * Update Toasts style * Update Clear Storage toast * Self review * Temporary testing toasts * Use customAction and prevent clear storage toast from closing * Fix Storage btn * Keep bg colour when autoClose is false * Remove testing code
- Loading branch information
1 parent
38687a3
commit 523c998
Showing
21 changed files
with
355 additions
and
224 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
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 |
---|---|---|
@@ -0,0 +1,63 @@ | ||
@import '../../../styles/fonts.module.scss'; | ||
|
||
@mixin text-gray { | ||
color: $color-gray-300; | ||
height: 20px; | ||
border: none; | ||
|
||
&.xs { | ||
padding: 0 16px; | ||
border-radius: 24px; | ||
height: 32px; | ||
@include font-body-14; | ||
} | ||
|
||
&.sm { | ||
padding: 0 20px; | ||
border-radius: 24px; | ||
height: 40px; | ||
@include font-button-3; | ||
} | ||
|
||
&.md { | ||
padding: 0 24px; | ||
border-radius: 28px; | ||
height: 48px; | ||
@include font-button-2; | ||
} | ||
|
||
&.lg { | ||
padding: 0 32px; | ||
border-radius: 32px; | ||
height: 56px; | ||
@include font-button-1; | ||
} | ||
|
||
&:hover { | ||
color: $color-base-light; | ||
} | ||
|
||
&:active { | ||
color: $color-gray-25; | ||
} | ||
|
||
&:disabled { | ||
color: $color-gray-600; | ||
} | ||
|
||
&.dark { | ||
color: $color-gray-600; | ||
|
||
&:hover { | ||
color: $color-gray-700; | ||
} | ||
|
||
&:active { | ||
color: $color-gray-800; | ||
} | ||
|
||
&:disabled { | ||
color: $color-gray-400; | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { ComponentProps } from 'react'; | ||
|
||
export const ExternalLinkIcon = (props: ComponentProps<'svg'>) => { | ||
return ( | ||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}> | ||
<path d="M12 12H4V4" stroke="currentColor" /> | ||
<path d="M6.27734 9.72515L11.6202 4.38086" stroke="currentColor" /> | ||
<path d="M8.08984 4.38086H11.6182V7.91076" stroke="currentColor" /> | ||
</svg> | ||
); | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { ComponentProps } from 'react'; | ||
|
||
export const InfoCircleFillIcon = (props: ComponentProps<'svg'>) => { | ||
return ( | ||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none" {...props}> | ||
<path | ||
fill-rule="evenodd" | ||
clip-rule="evenodd" | ||
d="M10 20C15.5228 20 20 15.5228 20 10C20 4.47715 15.5228 0 10 0C4.47715 0 0 4.47715 0 10C0 15.5228 4.47715 20 10 20ZM9.68634 4.80005C9.13406 4.80005 8.68634 5.24776 8.68634 5.80005C8.68634 6.35233 9.13406 6.80005 9.68634 6.80005H9.74908C10.3014 6.80005 10.7491 6.35233 10.7491 5.80005C10.7491 5.24776 10.3014 4.80005 9.74908 4.80005H9.68634ZM8.50003 7.50005C7.94775 7.50005 7.50003 7.94776 7.50003 8.50005C7.50003 9.05233 7.94775 9.50005 8.50003 9.50005H9.00574L9.00574 14.5C9.00574 14.7653 9.1111 15.0196 9.29863 15.2072C9.48617 15.3947 9.74052 15.5 10.0057 15.5H11.5C12.0523 15.5 12.5 15.0523 12.5 14.5C12.5 13.9478 12.0523 13.5 11.5 13.5H11.0057L11.0057 8.50005C11.0057 8.23483 10.9004 7.98048 10.7128 7.79294C10.5253 7.60541 10.271 7.50005 10.0057 7.50005H8.50003Z" | ||
fill="currentColor" | ||
/> | ||
</svg> | ||
); | ||
}; |
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,14 @@ | ||
import { ComponentProps } from 'react'; | ||
|
||
export const WarningCircleFillIcon = (props: ComponentProps<'svg'>) => { | ||
return ( | ||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none" {...props}> | ||
<path | ||
fillRule="evenodd" | ||
clipRule="evenodd" | ||
d="M10 20C15.5228 20 20 15.5228 20 10C20 4.47715 15.5228 0 10 0C4.47715 0 0 4.47715 0 10C0 15.5228 4.47715 20 10 20ZM10.9925 6.62503C10.9925 6.07275 10.5448 5.62503 9.99252 5.62503C9.44024 5.62503 8.99252 6.07275 8.99252 6.62503V11.125C8.99252 11.6773 9.44024 12.125 9.99252 12.125C10.5448 12.125 10.9925 11.6773 10.9925 11.125V6.62503ZM9.99252 12.375C9.44024 12.375 8.99252 12.8227 8.99252 13.375C8.99252 13.9273 9.44024 14.375 9.99252 14.375H10.0038C10.5561 14.375 11.0038 13.9273 11.0038 13.375C11.0038 12.8227 10.5561 12.375 10.0038 12.375H9.99252Z" | ||
fill="currentColor" | ||
/> | ||
</svg> | ||
); | ||
}; |
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,36 @@ | ||
import { useState } from 'react'; | ||
import { ALLOW_ANALYTICS, ALLOW_ERROR_REPORTING } from '../../utils/analytics'; | ||
import styles from './notifications.module.scss'; | ||
import Button from '../button'; | ||
|
||
export const ClearStorageButton = () => { | ||
const [isClearing, setIsClearing] = useState(false); | ||
|
||
const clearStorage = () => { | ||
setIsClearing(true); | ||
|
||
// Store the current values of the analytics and error reporting settings | ||
const errorReportingValue = window.localStorage.getItem(ALLOW_ERROR_REPORTING); | ||
const analyticsValue = window.localStorage.getItem(ALLOW_ANALYTICS); | ||
|
||
window.localStorage.clear(); | ||
|
||
// Restore the previous values of the analytics and error reporting settings | ||
if (errorReportingValue) { | ||
window.localStorage.setItem(ALLOW_ERROR_REPORTING, errorReportingValue); | ||
} | ||
if (analyticsValue) { | ||
window.localStorage.setItem(ALLOW_ANALYTICS, analyticsValue); | ||
} | ||
|
||
window.location.reload(); | ||
}; | ||
|
||
return ( | ||
<div className={styles.transactionButtonContainer}> | ||
<Button type="primary" size="xs" disabled={isClearing} onClick={clearStorage}> | ||
<span>{isClearing ? 'Clearing...' : 'Clear Storage'}</span> | ||
</Button> | ||
</div> | ||
); | ||
}; |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.