Skip to content

Commit 781d2ec

Browse files
authored
Redesign buttons (#35)
* style(): redesign "Go Back" button * style(): use buttons instead of links + change go back redirections
1 parent ce6f1e8 commit 781d2ec

File tree

8 files changed

+62
-32
lines changed

8 files changed

+62
-32
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"material-ui-numeric-input": "^3.1.1",
3939
"react": "^18.2.0",
4040
"react-dom": "^18.2.0",
41-
"react-icons": "^4.3.1",
41+
"react-icons": "^4.9.0",
4242
"react-input-number": "^5.0.19",
4343
"react-numeric-input": "^2.2.3",
4444
"react-ranger": "^2.1.0",

src/Components/ActionsReactions/ActionsReactions.tsx

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,17 @@ import CardContent from "@mui/material/CardContent";
77
import Button from "@mui/material/Button";
88
import Typography from "@mui/material/Typography";
99
import {
10-
AiOutlineBug,
11-
AiOutlinePlayCircle,
12-
AiOutlineSound,
13-
AiOutlineStop,
14-
AiOutlineVideoCamera,
15-
} from "react-icons/ai";
16-
import { MdPanoramaHorizontal } from "react-icons/md";
17-
import {
18-
IconButton,
19-
InputLabel,
20-
MenuItem,
21-
Select,
22-
SelectChangeEvent,
10+
IconButton
2311
} from "@mui/material";
24-
import { BsTrash } from "react-icons/bs";
12+
import { BsTrash, BsArrowLeft, BsArrowRight } from "react-icons/bs";
13+
import { BsArrowReturnLeft } from "react-icons/bs"
2514
import { Link } from "react-router-dom";
2615
import {
2716
getActReactCouplesFormat,
28-
actionReactionFormat,
2917
removeActReactAnswer,
3018
} from "../../Socket/interfaces";
3119
import {
3220
ActionType,
33-
action_reaction,
3421
action_reaction_identified,
3522
} from "./WordDetection/WordDetection";
3623
import { toast } from "react-toastify";
@@ -247,13 +234,17 @@ export const ActionsReactions = () => {
247234

248235
<div className="create_actions_button_pos">
249236
<Link className="m-2" to="/actions-reactions/actions">
250-
Create Actions
237+
<Button variant="outlined" startIcon={<BsArrowLeft />} color="warning">
238+
Create Actions
239+
</Button>
251240
</Link>
252241
</div>
253242

254243
<div className="create_reactions_button_pos">
255244
<Link className="m-2" to="/actions-reactions/reactions">
256-
Create Reactions
245+
<Button variant="outlined" endIcon={<BsArrowRight />} color="warning">
246+
Create Reactions
247+
</Button>
257248
</Link>
258249
</div>
259250
</>

src/Components/ActionsReactions/AppLaunch/AppLaunch.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ import React, { Component, useEffect, useState } from "react";
22
import { AddAppLaunch } from "../AddAppLaunch/AddAppLaunch";
33
import { Link } from "react-router-dom";
44
import { toast } from "react-toastify";
5+
import Button from "@mui/material/Button";
6+
7+
import { BsArrowReturnLeft } from "react-icons/bs"
58

6-
import { Button } from "@mui/material";
79

810
import useAxiosPrivate from "../../../hooks/useAxiosPrivate";
911

@@ -282,7 +284,11 @@ export const AppLaunch = (props: any) => {
282284
newEvent={newEvent}
283285
setnewEvent={setnewEvent}
284286
/>
285-
<Link style={{ "paddingTop": "20px" }} to="/actions-reactions/home">Go Back</Link>
287+
<Link style={{ "paddingTop": "20px" }} to="/actions-reactions/actions">
288+
<Button variant="outlined" startIcon={<BsArrowReturnLeft />} color="info">
289+
Go Back
290+
</Button>
291+
</Link>
286292

287293
</>
288294
)

src/Components/ActionsReactions/CreateActions/CreateActions.tsx

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,44 @@ import {
44
Route,
55
Link
66
} from "react-router-dom";
7+
import Button from "@mui/material/Button";
8+
import { BsArrowReturnLeft, BsFonts, BsKeyboard, BsRocketTakeoff } from "react-icons/bs"
79
import './CreateActions.css';
810

11+
912
export const CreateActions = () => {
1013
return (
1114
<>
1215
{/* Display a heading */}
1316
<h1 className="m-2"> Select an action</h1>
1417

1518
{/* Link to the "Word Detection" page */}
16-
<Link className="m-6" to="/actions-reactions/word-detection">Word Detection</Link>
19+
<Link className="m-6" to="/actions-reactions/word-detection">
20+
<Button variant="contained" size="large" startIcon={<BsFonts />} color="warning">
21+
Word Detection
22+
</Button>
23+
</Link>
1724

1825
{/* Link to the "Key Pressed" page */}
19-
<Link className="m-6" to="/actions-reactions/key-pressed">Key Pressed</Link>
26+
<Link className="m-6" to="/actions-reactions/key-pressed">
27+
<Button variant="contained" size="large" startIcon={<BsKeyboard />} color="warning">
28+
Key Pressed
29+
</Button>
30+
</Link>
2031

2132
{/* Link to the "App Launch" page */}
22-
<Link className="m-6" to="/actions-reactions/app-launch">App Launch</Link>
33+
<Link className="m-6" to="/actions-reactions/app-launch">
34+
<Button variant="contained" size="large" startIcon={<BsRocketTakeoff />} color="warning">
35+
App Launch
36+
</Button>
37+
</Link>
2338

2439
{/* Link to go back to the home page */}
25-
<Link className="go-back-link" to="/actions-reactions/home">Go Back</Link>
40+
<Link className="go-back-link" to="/actions-reactions/home">
41+
<Button variant="outlined" startIcon={<BsArrowReturnLeft />} color="info">
42+
Go Back
43+
</Button>
44+
</Link>
2645
</>
2746
);
2847
}

src/Components/ActionsReactions/CreateReactions/CreateReactions.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import CardActions from "@mui/material/CardActions";
66
import CardContent from "@mui/material/CardContent";
77
import Button from "@mui/material/Button";
88
import Typography from "@mui/material/Typography";
9+
import { BsArrowReturnLeft } from "react-icons/bs"
910
import {
1011
AiFillVideoCamera,
1112
AiOutlineBug,
@@ -281,7 +282,9 @@ export const CreateReactions = () => {
281282
</div>
282283

283284
<Link className="pt-20" to="/actions-reactions/home">
284-
Go Back
285+
<Button variant="outlined" startIcon={<BsArrowReturnLeft />} color="info">
286+
Go Back
287+
</Button>
285288
</Link>
286289

287290
<Dialog open={open} onClose={handleCancel}>

src/Components/ActionsReactions/KeyPressed/KeyPressed.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import {
99
import { AddNewKeyPressed } from "../AddNewKeyPressed/AddNewKeyPressed";
1010
import { Link } from "react-router-dom";
1111
import { toast } from "react-toastify";
12+
import Button from "@mui/material/Button";
13+
import { BsArrowReturnLeft } from "react-icons/bs"
1214
const ipcRenderer = window.require("electron").ipcRenderer;
1315

1416
export enum ActionType {
@@ -231,8 +233,10 @@ export const KeyPressed = (props: any) => {
231233
newEvent={newEvent}
232234
setnewEvent={setnewEvent}
233235
/>
234-
<Link style={{ paddingTop: "20px" }} to="/actions-reactions/home">
235-
Go Back
236+
<Link style={{ paddingTop: "20px" }} to="/actions-reactions/actions">
237+
<Button variant="outlined" startIcon={<BsArrowReturnLeft />} color="info">
238+
Go Back
239+
</Button>
236240
</Link>
237241
</>
238242
)}

src/Components/ActionsReactions/WordDetection/WordDetection.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import React, { Component, useEffect, useState } from "react";
22
import { AddNewWord } from "../AddNewWord/AddNewWord";
33
import { Link } from "react-router-dom";
4-
4+
import Button from "@mui/material/Button";
5+
import { BsArrowReturnLeft } from "react-icons/bs"
56
import useAxiosPrivate from "../../../hooks/useAxiosPrivate";
67

78
import BoxEvent from "../../BoxEvent/BoxEvent";
@@ -247,8 +248,10 @@ export const WordDetection = (props: any) => {
247248
newEvent={newEvent}
248249
setnewEvent={setnewEvent}
249250
/>
250-
<Link style={{ paddingTop: "20px" }} to="/actions-reactions/home">
251-
Go Back
251+
<Link style={{ paddingTop: "20px" }} to="/actions-reactions/actions">
252+
<Button variant="outlined" startIcon={<BsArrowReturnLeft />} color="info">
253+
Go Back
254+
</Button>
252255
</Link>
253256
</>
254257
)}

src/Components/Unauthorized/Unauthorized.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import React from "react";
22
import { useNavigate } from "react-router-dom";
3+
import Button from "@mui/material/Button";
4+
import { BsArrowReturnLeft } from "react-icons/bs"
35

46
const Unauthorized = () => {
57
const navigate = useNavigate();
@@ -13,7 +15,9 @@ const Unauthorized = () => {
1315
<p>You do not have access to the requested page.</p>
1416
<p>Upgrade your subscription to access it.</p>
1517
<div className="flexGrow">
16-
<button onClick={goBack}>Go Back</button>
18+
<Button onClick={goBack} variant="outlined" startIcon={<BsArrowReturnLeft />} color="info">
19+
Go Back
20+
</Button>
1721
</div>
1822
</>
1923
);

0 commit comments

Comments
 (0)