-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(react): Change dashboard UI to new table (#876)
- Loading branch information
1 parent
085b194
commit a9b3c9c
Showing
38 changed files
with
1,288 additions
and
630 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"trailingComma": "es5", | ||
"tabWidth": 2, | ||
"semi": true, | ||
"singleQuote": true | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
import Keycloak from "keycloak-js"; | ||
import Keycloak from 'keycloak-js'; | ||
const keycloak = new Keycloak({ | ||
url: "https://auth.keksdose.xyz", | ||
realm: "laughing-train", | ||
clientId: "laughing-train", | ||
url: 'https://auth.keksdose.xyz', | ||
realm: 'laughing-train', | ||
clientId: 'laughing-train', | ||
}); | ||
|
||
export default keycloak; | ||
export default keycloak; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,22 @@ | ||
import { Alert, Typography } from "@mui/material"; | ||
import { useKeycloak } from "@react-keycloak/web"; | ||
import { Alert, Typography } from '@mui/material'; | ||
import { useKeycloak } from '@react-keycloak/web'; | ||
|
||
const PrivateRoute = (child: any ) => { | ||
const PrivateRoute = (child: any) => { | ||
const { keycloak } = useKeycloak(); | ||
|
||
const isLoggedIn = keycloak.authenticated; | ||
return isLoggedIn ? child.children : <> | ||
<Alert severity="error"> <Typography variant="h4">You are not logged in. Please log in to access this page.</Typography></Alert> | ||
</>; | ||
return isLoggedIn ? ( | ||
child.children | ||
) : ( | ||
<> | ||
<Alert severity="error"> | ||
{' '} | ||
<Typography variant="h4"> | ||
You are not logged in. Please log in to access this page. | ||
</Typography> | ||
</Alert> | ||
</> | ||
); | ||
}; | ||
|
||
export default PrivateRoute; | ||
export default PrivateRoute; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,24 @@ | ||
import { Card, CardMedia, Typography } from "@mui/material"; | ||
import React from "react"; | ||
import { BiPlus } from "react-icons/bi"; | ||
import { useNavigate } from "react-router"; | ||
import { Card, CardMedia, Typography } from '@mui/material'; | ||
import React from 'react'; | ||
import { BiPlus } from 'react-icons/bi'; | ||
import { useNavigate } from 'react-router'; | ||
|
||
export function AddProjectCard() { | ||
const navigate = useNavigate(); | ||
return ( | ||
<Card onClick={() => navigate("/mutation/addproject")} sx={{ display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center" }}> | ||
<Card | ||
onClick={() => navigate('/mutation/addproject')} | ||
sx={{ | ||
display: 'flex', | ||
flexDirection: 'column', | ||
alignItems: 'center', | ||
justifyContent: 'center', | ||
}} | ||
> | ||
<CardMedia> | ||
<BiPlus size={100} /> | ||
</CardMedia> | ||
<Typography variant="h3">Add Project</Typography> | ||
</Card> | ||
); | ||
} | ||
} |
Oops, something went wrong.