Skip to content

Commit

Permalink
feat: a generated story can be closed (#92)
Browse files Browse the repository at this point in the history
## Motivation

<!-- List motivation and changes here -->

When the story is open
And the user clicks the close icon
Then the story form is shown

## Issues closed

<!-- List closed issues here -->
  • Loading branch information
pixelass committed Mar 19, 2024
1 parent efe56da commit 902be83
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/client/apps/story/index.tsx
@@ -1,9 +1,12 @@
import { CustomScrollbars } from "@captn/joy/custom-scrollbars";
import { useSDK } from "@captn/react/use-sdk";
import { localFile } from "@captn/utils/string";
import ClearIcon from "@mui/icons-material/Clear";
import Box from "@mui/joy/Box";
import Grid from "@mui/joy/Grid";
import IconButton from "@mui/joy/IconButton";
import LinearProgress from "@mui/joy/LinearProgress";
import Sheet from "@mui/joy/Sheet";
import Typography from "@mui/joy/Typography";
import dayjs from "dayjs";
import { useAtom } from "jotai";
Expand Down Expand Up @@ -121,6 +124,16 @@ export function Story() {
return (
<CustomScrollbars>
<Box sx={{ p: 2 }}>
<Sheet sx={{ display: "flex", justifyContent: "flex-end" }}>
<IconButton
aria-label={t("labels:close")}
onClick={() => {
setStory("");
}}
>
<ClearIcon />
</IconButton>
</Sheet>
<Markdown
markdown={story}
images={selectedImages.map(image => localFile(image.filePath))}
Expand Down

0 comments on commit 902be83

Please sign in to comment.