Skip to content

Commit 20abbad

Browse files
committed
make some buttons a little nicer to use
1 parent 944164d commit 20abbad

2 files changed

Lines changed: 33 additions & 20 deletions

File tree

src/ui/screens/benefit-page/components/BenefitPageLinksList.js

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -91,21 +91,31 @@ const BenefitPageLinksList = ({ listTitle, data }) => {
9191
<VBox gap={1}>
9292
{
9393
data.links.map((link, index) => (
94-
<a key={index} href={link.url} target="_blank" rel="noopener noreferrer" style={{ textDecoration: 'none' }}>
95-
<Button variant="text" sx={{
96-
padding: 1, color: 'pink.main', textDecoration: 'underline',
94+
<Button
95+
component="a"
96+
href={link.url}
97+
target="_blank"
98+
rel="noopener noreferrer"
99+
variant="text"
100+
disableRipple
101+
disableFocusRipple
102+
onMouseUp={e => e.currentTarget.blur()}
103+
sx={{
104+
padding: 1,
105+
color: 'pink.main',
106+
textDecoration: 'underline',
97107
'&:hover': {
98108
backgroundColor: 'transparent',
99109
color: 'black.main',
100110
textDecoration: 'underline',
101-
}
102-
}}>
103-
<HBox sx={{ alignItems: 'center' }} >
104-
<OpenInNewIcon sx={{ fontSize: '20px' }} />
105-
<Typography sx={{ color: "inherit" }} variant="body1">{link.title}</Typography>
106-
</HBox>
107-
</Button>
108-
</a>
111+
},
112+
}}
113+
>
114+
<HBox sx={{ alignItems: 'center' }} >
115+
<OpenInNewIcon sx={{ fontSize: '20px' }} />
116+
<Typography sx={{ color: "inherit" }} variant="body1">{link.title}</Typography>
117+
</HBox>
118+
</Button>
109119
))
110120
}
111121
</VBox>
@@ -129,13 +139,13 @@ const BenefitPageLinksList = ({ listTitle, data }) => {
129139
findNearestCounselingCentres()
130140
}}
131141
>Find nearest counseling centres</a>
132-
:
142+
:
133143
<div>
134144
<ul>
135145
{nearestCounselingCenters.map((cc, index) => (
136146
<li key={index} style={{ marginBottom: '1rem' }}>
137-
<small style={{ color: "gray"}}>{cc.distance} km</small> <strong>{cc.title}</strong>
138-
<br/>
147+
<small style={{ color: "gray" }}>{cc.distance} km</small> <strong>{cc.title}</strong>
148+
<br />
139149
<small><a href={buildOsmUrl(cc)} target="_blank" rel="noopener noreferrer">{cc.address}</a></small>
140150
</li>
141151
))}
@@ -146,11 +156,11 @@ const BenefitPageLinksList = ({ listTitle, data }) => {
146156
</>
147157
:
148158
<span>
149-
{/* eslint-disable jsx-a11y/anchor-is-valid */}
150-
<a href="#" onClick={(e) => {
151-
e.preventDefault()
152-
convertAddressToCoordinates()
153-
}}>Click here</a> to convert your address to coordinates using nominatim.org
159+
{/* eslint-disable jsx-a11y/anchor-is-valid */}
160+
<a href="#" onClick={(e) => {
161+
e.preventDefault()
162+
convertAddressToCoordinates()
163+
}}>Click here</a> to convert your address to coordinates using nominatim.org
154164
</span>
155165
}
156166
</VBox>

src/ui/screens/onboarding-pages/components/ClickableTopicBox.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ const ClickableTopicBox = ({ topic, onClick }) => {
1010
return (
1111
<HBox>
1212
<Button
13-
onClick={() => onClick(topic)}
13+
onClick={(e) => {
14+
onClick(topic);
15+
e.currentTarget.blur()
16+
}}
1417
sx={{
1518
flex: 1,
1619
justifyContent: 'center',

0 commit comments

Comments
 (0)