Skip to content

Commit 3650328

Browse files
committed
Add close button to modals
1 parent d1fc283 commit 3650328

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed

src/components/organisms/AppModeModal.tsx

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import {
99
featureAppModeSelect,
1010
} from '../../lib/checkedFeatures'
1111
import ModalContainer from '../molecules/ModalContainer'
12+
import Icon from '../atoms/Icon'
13+
import { mdiClose } from '@mdi/js'
1214

1315
const AppModeModal = () => {
1416
const { setPreferences } = usePreferences()
@@ -35,6 +37,9 @@ const AppModeModal = () => {
3537
return (
3638
<ModalContainer onShadowClick={closeModal}>
3739
<Container>
40+
<button className='closeButton' onClick={closeModal}>
41+
<Icon path={mdiClose} />
42+
</button>
3843
<div className='scrollable'>
3944
<h1 className='header'>Choose App Mode</h1>
4045
<div className='optionGroup'>
@@ -74,6 +79,30 @@ const Container = styled.div`
7479
${border}
7580
border-radius: 10px;
7681
overflow: hidden;
82+
& > .closeButton {
83+
position: absolute;
84+
top: 0;
85+
right: 0;
86+
width: 40px;
87+
height: 40px;
88+
border: none;
89+
background-color: transparent;
90+
cursor: pointer;
91+
box-sizing: border-box;
92+
font-size: 18px;
93+
outline: none;
94+
95+
transition: color 200ms ease-in-out;
96+
color: ${({ theme }) => theme.navButtonColor};
97+
&:hover {
98+
color: ${({ theme }) => theme.navButtonHoverColor};
99+
}
100+
101+
&:active,
102+
&.active {
103+
color: ${({ theme }) => theme.navButtonActiveColor};
104+
}
105+
}
77106
.scrollable {
78107
padding: 0 10px;
79108
overflow-y: auto;

src/components/organisms/BoostHubIntroModal.tsx

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import { FormPrimaryButton } from '../atoms/form'
1111
import BoostHubFeatureIntro from '../molecules/BoostHubFeatureIntro'
1212
import { useRouter } from '../../lib/router'
1313
import { dispatchBoostHubLoginRequestEvent } from '../../lib/events'
14+
import { mdiClose } from '@mdi/js'
15+
import Icon from '../atoms/Icon'
1416

1517
const BoostHubIntroModal = () => {
1618
const { checkFeature } = useCheckedFeatures()
@@ -32,6 +34,9 @@ const BoostHubIntroModal = () => {
3234
return (
3335
<ModalContainer onShadowClick={close}>
3436
<Container>
37+
<button className='closeButton' onClick={close}>
38+
<Icon path={mdiClose} />
39+
</button>
3540
<h1 className='heading'>Start Collaborating</h1>
3641
<p className='description'>
3742
We&apos;re very excited to release the collaboration feature. You can
@@ -65,6 +70,30 @@ const Container = styled.div`
6570
border-radius: 10px;
6671
overflow-x: hidden;
6772
overflow-y: auto;
73+
& > .closeButton {
74+
position: absolute;
75+
top: 0;
76+
right: 0;
77+
width: 40px;
78+
height: 40px;
79+
border: none;
80+
background-color: transparent;
81+
cursor: pointer;
82+
box-sizing: border-box;
83+
font-size: 18px;
84+
outline: none;
85+
86+
transition: color 200ms ease-in-out;
87+
color: ${({ theme }) => theme.navButtonColor};
88+
&:hover {
89+
color: ${({ theme }) => theme.navButtonHoverColor};
90+
}
91+
92+
&:active,
93+
&.active {
94+
color: ${({ theme }) => theme.navButtonActiveColor};
95+
}
96+
}
6897
& > .heading {
6998
text-align: center;
7099
text-transform: uppercase;

0 commit comments

Comments
 (0)