|
1 | 1 | ---
|
2 | 2 | import Alert from '@components/Alert/Alert.astro'
|
3 |
| -import Card from '@components/Card/Card.astro' |
4 |
| -import Input from '@components/Input/Input.astro' |
5 |
| -import Icon from '@components/Icon/Icon.astro' |
| 3 | +import Avatar from '@components/Avatar/Avatar.astro' |
6 | 4 | import Badge from '@components/Badge/Badge.astro'
|
7 | 5 | import Button from '@components/Button/Button.astro'
|
| 6 | +import Card from '@components/Card/Card.astro' |
8 | 7 | import Checkbox from '@components/Checkbox/Checkbox.astro'
|
| 8 | +import Input from '@components/Input/Input.astro' |
| 9 | +import Icon from '@components/Icon/Icon.astro' |
| 10 | +import Modal from '@components/Modal/Modal.astro' |
| 11 | +import Progress from '@components/Progress/Progress.astro' |
9 | 12 | import Radio from '@components/Radio/Radio.astro'
|
| 13 | +import Rating from '@components/Rating/Rating.astro' |
| 14 | +import Spinner from '@components/Spinner/Spinner.astro' |
10 | 15 | import Switch from '@components/Switch/Switch.astro'
|
11 |
| -import Avatar from '@components/Avatar/Avatar.astro' |
12 | 16 | import Tabs from '@components/Tabs/Tabs.astro'
|
13 | 17 | import Table from '@components/Table/Table.astro'
|
14 | 18 | import Timeline from '@components/Timeline/Timeline.astro'
|
15 |
| -import Progress from '@components/Progress/Progress.astro' |
16 |
| -import Rating from '@components/Rating/Rating.astro' |
17 |
| -import Spinner from '@components/Spinner/Spinner.astro' |
18 | 19 | import TimelineItem from '@components/TimelineItem/TimelineItem.astro'
|
| 20 | +import Toast from '@components/Toast/Toast.astro' |
19 | 21 |
|
20 | 22 | import { avatarGroup, avatarGroupAlt2 } from '@data'
|
21 | 23 |
|
@@ -94,7 +96,7 @@ const tasks = [
|
94 | 96 | subText="Enable or disable all of your notification with one click. Previous settings will be overwritten."
|
95 | 97 | />
|
96 | 98 | <Switch label="Security emails" toggled={true} />
|
97 |
| - <Switch label="Marketing emails" /> |
| 99 | + <Switch label="Marketing emails" className="marketing" /> |
98 | 100 | <hr />
|
99 | 101 | <strong class="slack">Slack notifications</strong>
|
100 | 102 | <Radio
|
@@ -220,6 +222,16 @@ const tasks = [
|
220 | 222 | <span>Connect your project to GitHub to start running automatic deployments.</span>
|
221 | 223 | <Button className="connect">Connect</Button>
|
222 | 224 | </Alert>
|
| 225 | + |
| 226 | + <Toast theme="success" className="marketing-toast"> |
| 227 | + Marketing emails enabled |
| 228 | + </Toast> |
| 229 | + |
| 230 | + <Modal title="Are you sure?" subTitle="Confirm update" className="modal"> |
| 231 | + <p>Automatic deployments will be enabled for your project.</p> |
| 232 | + <Button className="close-modal">Confirm</Button> |
| 233 | + <Button theme="secondary" className="close-modal">Cancel</Button> |
| 234 | + </Modal> |
223 | 235 | </div>
|
224 | 236 | </div>
|
225 | 237 |
|
@@ -280,3 +292,29 @@ const tasks = [
|
280 | 292 | @include typography(md);
|
281 | 293 | }
|
282 | 294 | </style>
|
| 295 | + |
| 296 | +<script> |
| 297 | + import { toast } from '@utils/toast' |
| 298 | + import { modal, closeModal } from '@utils/modal' |
| 299 | + |
| 300 | + const marketing = document.querySelector('.marketing input') |
| 301 | + const connect = document.querySelector('.connect') |
| 302 | + const closeButton = document.querySelectorAll('.close-modal') |
| 303 | + |
| 304 | + marketing?.addEventListener('change', (e: any) => { |
| 305 | + toast({ |
| 306 | + element: '.marketing-toast', |
| 307 | + content: e.target.checked |
| 308 | + ? 'Marketing emails enabled' |
| 309 | + : 'Marketing emails disabled' |
| 310 | + }) |
| 311 | + }) |
| 312 | + |
| 313 | + connect?.addEventListener('click', () => { |
| 314 | + modal('.modal') |
| 315 | + }) |
| 316 | + |
| 317 | + Array.from(closeButton).forEach(button => { |
| 318 | + button?.addEventListener('click', () => closeModal('.modal')) |
| 319 | + }) |
| 320 | +</script> |
0 commit comments