generated from daystram/go-gin-gorm-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #74 from deco-finter/fix/code-quality
Improve code quality
- Loading branch information
Showing
6 changed files
with
104 additions
and
118 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,49 @@ | ||
import { Button, Grid, Icon } from "@material-ui/core"; | ||
import { Link } from "react-router-dom"; | ||
import { proto as pb } from "../proto/message_pb"; | ||
|
||
export default function StoryCompletionPrompt(props: { | ||
restartSession: () => void; | ||
sessionInfo: pb.WSControlMessageData | undefined; | ||
}) { | ||
const { restartSession, sessionInfo } = props; | ||
|
||
return ( | ||
<> | ||
<Grid item xs={12}> | ||
<Button | ||
variant="contained" | ||
color="primary" | ||
endIcon={<Icon fontSize="small">brush</Icon>} | ||
className="mb-2" | ||
onClick={() => restartSession()} | ||
> | ||
Create another story | ||
</Button> | ||
</Grid> | ||
<Grid item xs={12}> | ||
<Button | ||
variant="contained" | ||
color="secondary" | ||
component={Link} | ||
endIcon={<Icon fontSize="small">photo</Icon>} | ||
to={`/gallery/${sessionInfo?.classroomId}/${sessionInfo?.sessionId}`} | ||
className="mb-2" | ||
> | ||
View completed story | ||
</Button> | ||
</Grid> | ||
<Grid item xs={12}> | ||
<Button | ||
variant="contained" | ||
color="secondary" | ||
component={Link} | ||
endIcon={<Icon fontSize="small">book</Icon>} | ||
to={`/gallery/${sessionInfo?.classroomId}`} | ||
> | ||
View classroom gallery | ||
</Button> | ||
</Grid> | ||
</> | ||
); | ||
} |
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,29 @@ | ||
import { Button } from "@material-ui/core"; | ||
import { colors } from "../../colors"; | ||
|
||
export default function ColorPaletteIcon(props: { | ||
color: string; | ||
toolColor: string; | ||
onClick: () => void; | ||
}) { | ||
const { color, toolColor, onClick } = props; | ||
return ( | ||
<Button | ||
component="div" | ||
onClick={onClick} | ||
style={{ | ||
backgroundColor: color, | ||
width: "38px", | ||
height: "38px", | ||
padding: 0, | ||
margin: 4, | ||
minWidth: "auto", | ||
borderRadius: 4, | ||
border: `${toolColor === color ? 2 : 1}px solid ${ | ||
toolColor === color ? colors.orange.main : "#AAA8" | ||
}`, | ||
}} | ||
key={color} | ||
/> | ||
); | ||
} |
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
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