Skip to content

Commit 177d505

Browse files
committed
Hover styling on export button
1 parent 23871a0 commit 177d505

File tree

2 files changed

+29
-13
lines changed

2 files changed

+29
-13
lines changed

app/src/components/right/ExportButton.tsx

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@ export default function ExportButton() {
1515
const [modal, setModal] = useState(null);
1616
const state = useSelector((store: RootState) => store.appState);
1717

18-
const genOptions: string[] = [
19-
'Export components'
20-
];
18+
const genOptions: string[] = ['Export components'];
2119

2220
// Closes out the open modal
2321
const closeModal = () => setModal('');
@@ -27,6 +25,7 @@ export default function ExportButton() {
2725
<List className="export-preference">
2826
{genOptions.map((option: string, i: number) => (
2927
<ListItem
28+
id="export-modal"
3029
key={i}
3130
onClick={() => chooseGenOptions()}
3231
style={{
@@ -60,7 +59,7 @@ export default function ExportButton() {
6059
);
6160
};
6261

63-
const exportKeyBind = useCallback(e => {
62+
const exportKeyBind = useCallback((e) => {
6463
//Export Project
6564
(e.key === 'e' && e.metaKey) || (e.key === 'e' && e.ctrlKey)
6665
? showGenerateAppModal()
@@ -75,10 +74,18 @@ export default function ExportButton() {
7574
}, []);
7675
return (
7776
<div>
78-
<button onClick={showGenerateAppModal}>Export Project
79-
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" className="bi bi-download" viewBox="0 0 16 16">
80-
<path d="M.5 9.9a.5.5 0 0 1 .5.5v2.5a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-2.5a.5.5 0 0 1 1 0v2.5a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2v-2.5a.5.5 0 0 1 .5-.5z"/>
81-
<path d="M7.646 11.854a.5.5 0 0 0 .708 0l3-3a.5.5 0 0 0-.708-.708L8.5 10.293V1.5a.5.5 0 0 0-1 0v8.793L5.354 8.146a.5.5 0 1 0-.708.708l3 3z"/>
77+
<button onClick={showGenerateAppModal}>
78+
Export Project
79+
<svg
80+
xmlns="http://www.w3.org/2000/svg"
81+
width="16"
82+
height="16"
83+
fill="currentColor"
84+
className="bi bi-download"
85+
viewBox="0 0 16 16"
86+
>
87+
<path d="M.5 9.9a.5.5 0 0 1 .5.5v2.5a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-2.5a.5.5 0 0 1 1 0v2.5a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2v-2.5a.5.5 0 0 1 .5-.5z" />
88+
<path d="M7.646 11.854a.5.5 0 0 0 .708 0l3-3a.5.5 0 0 0-.708-.708L8.5 10.293V1.5a.5.5 0 0 0-1 0v8.793L5.354 8.146a.5.5 0 1 0-.708.708l3 3z" />
8289
</svg>
8390
</button>
8491
{modal}
@@ -90,7 +97,6 @@ export default function ExportButton() {
9097
//The below code is exclusive to ReacType's Electron App
9198
//If you would like to deploy the app, please comment out the exportButton function above and uncomment the code below
9299

93-
94100
// export default function ExportButton() {
95101
// const [modal, setModal] = useState(null);
96102
// const state = useSelector(store => store.appState)

app/src/public/styles/style.css

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,11 @@ LEFT COLUMN
121121
align-self: center;
122122
}
123123

124+
span.material-symbols-outlined {
125+
padding: 1px;
126+
font-size: 18px;
127+
}
128+
124129
.left {
125130
padding: 0px;
126131
display: flex;
@@ -328,15 +333,20 @@ h1 {
328333
}
329334

330335
.export-preference div span {
331-
transition: color 1s, background-color 1.5s, transform 2s;
336+
transition: .5s
332337
}
333338

334-
.export-preference div:hover {
339+
#export-modal {
340+
transition: .5s
341+
}
342+
343+
#export-modal:hover {
335344
background-color: #303f9f;
345+
cursor: pointer;
336346
}
337347

338-
.export-preference div:hover span {
339-
color: white;
348+
#export-modal:hover span {
349+
color: white
340350
}
341351

342352
.info {

0 commit comments

Comments
 (0)