-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
82cdd46
commit a39840c
Showing
5 changed files
with
183 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { getServerSession } from "next-auth" | ||
import { Box, Link, Typography } from "@mui/joy" | ||
|
||
import { authOptions } from "@/app/api/auth/[...nextauth]/route" | ||
import ContentContainer from "@/components/content-container" | ||
import ApiKeysList from "@/components/api-keys/list" | ||
import ApiKeyCreate from "@/components/api-keys/create" | ||
|
||
export default async function Home() { | ||
const session = await getServerSession(authOptions) | ||
return ( | ||
<ContentContainer> | ||
<Box | ||
sx={{ | ||
display: "flex", | ||
flexDirection: "column", | ||
rowGap: "1em", | ||
alignItems: "flex-start", | ||
maxWidth: "90em", | ||
margin: "0 auto", | ||
width: "100%", | ||
}} | ||
> | ||
<Box | ||
sx={{ | ||
display: "flex", | ||
flexDirection: "row", | ||
justifyContent: "space-between", | ||
alignItems: "center", | ||
maxWidth: "90em", | ||
margin: "0 auto", | ||
width: "100%", | ||
}} | ||
> | ||
<Typography> | ||
Your API Keys that can be used to access the{" "} | ||
<Link href="https://dev.blink.sv/">Blink API</Link> | ||
</Typography> | ||
<ApiKeyCreate /> | ||
</Box> | ||
<ApiKeysList /> | ||
</Box> | ||
</ContentContainer> | ||
) | ||
} |
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,71 @@ | ||
"use client" | ||
|
||
import { Box, Button, Modal, ModalClose, Sheet, Typography } from "@mui/joy" | ||
import AddIcon from "@mui/icons-material/Add" | ||
import { useState } from "react" | ||
|
||
const ApiKeyCreate = () => { | ||
const [open, setOpen] = useState(false) | ||
return ( | ||
<> | ||
<Button onClick={() => setOpen(true)} variant="outlined" color="primary"> | ||
{<AddIcon />} | ||
</Button> | ||
<Modal | ||
open={open} | ||
onClose={() => setOpen(false)} | ||
sx={{ display: "flex", justifyContent: "center", alignItems: "center" }} | ||
> | ||
<Sheet | ||
variant="outlined" | ||
sx={{ | ||
maxWidth: 600, | ||
borderRadius: "md", | ||
p: 3, | ||
boxShadow: "lg", | ||
display: "flex", | ||
flexDirection: "column", | ||
gap: 2, | ||
alignItems: "flex-start", | ||
}} | ||
> | ||
<ModalClose variant="plain" sx={{ alignSelf: "flex-end" }} /> | ||
<Box | ||
sx={{ | ||
display: "flex", | ||
flexDirection: "column", | ||
alignItems: "center", | ||
}} | ||
> | ||
<Typography | ||
component="h2" | ||
id="modal-title" | ||
level="h4" | ||
textColor="inherit" | ||
fontWeight="lg" | ||
> | ||
Create API Key | ||
</Typography> | ||
</Box> | ||
<Typography id="modal-desc" textColor="text.tertiary" textAlign="left"> | ||
Create an API Key to use with your Blink Account. | ||
</Typography> | ||
<Button | ||
variant="outlined" | ||
color="primary" | ||
onClick={async () => { | ||
setOpen(false) | ||
}} | ||
sx={{ | ||
width: "100%", | ||
}} | ||
> | ||
Create | ||
</Button> | ||
</Sheet> | ||
</Modal> | ||
</> | ||
) | ||
} | ||
|
||
export default ApiKeyCreate |
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,57 @@ | ||
import * as React from "react" | ||
import Table from "@mui/joy/Table" | ||
|
||
const ApiKeysList = () => { | ||
return ( | ||
<Table aria-label="basic table"> | ||
<thead> | ||
<tr> | ||
<th style={{ width: "40%" }}>Dessert (100g serving)</th> | ||
<th>Calories</th> | ||
<th>Fat (g)</th> | ||
<th>Carbs (g)</th> | ||
<th>Protein (g)</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<td>Frozen yoghurt</td> | ||
<td>159</td> | ||
<td>6</td> | ||
<td>24</td> | ||
<td>4</td> | ||
</tr> | ||
<tr> | ||
<td>Ice cream sandwich</td> | ||
<td>237</td> | ||
<td>9</td> | ||
<td>37</td> | ||
<td>4.3</td> | ||
</tr> | ||
<tr> | ||
<td>Eclair</td> | ||
<td>262</td> | ||
<td>16</td> | ||
<td>24</td> | ||
<td>6</td> | ||
</tr> | ||
<tr> | ||
<td>Cupcake</td> | ||
<td>305</td> | ||
<td>3.7</td> | ||
<td>67</td> | ||
<td>4.3</td> | ||
</tr> | ||
<tr> | ||
<td>Gingerbread</td> | ||
<td>356</td> | ||
<td>16</td> | ||
<td>49</td> | ||
<td>3.9</td> | ||
</tr> | ||
</tbody> | ||
</Table> | ||
) | ||
} | ||
|
||
export default ApiKeysList |
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