-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(slice-machine-ui): update Slice Builder layout
- Loading branch information
Showing
18 changed files
with
211 additions
and
356 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
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
64 changes: 0 additions & 64 deletions
64
packages/slice-machine/lib/builders/SliceBuilder/Header/index.tsx
This file was deleted.
Oops, something went wrong.
97 changes: 97 additions & 0 deletions
97
packages/slice-machine/lib/builders/SliceBuilder/OldSideBar/index.tsx
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,97 @@ | ||
import React from "react"; | ||
|
||
import { Box, Flex } from "theme-ui"; | ||
|
||
import Card from "@components/Card"; | ||
import { ReactTooltipPortal } from "@components/ReactTooltipPortal"; | ||
|
||
import { ScreenshotPreview } from "@components/ScreenshotPreview"; | ||
|
||
import { ComponentUI } from "@lib/models/common/ComponentUI"; | ||
import ScreenshotChangesModal from "@components/ScreenshotChangesModal"; | ||
import { useScreenshotChangesModal } from "@src/hooks/useScreenshotChangesModal"; | ||
import { Button } from "@components/Button"; | ||
import { AiOutlineCamera } from "react-icons/ai"; | ||
import { VariationSM } from "@lib/models/common/Slice"; | ||
import ReactTooltip from "react-tooltip"; | ||
|
||
type SideBarProps = { | ||
component: ComponentUI; | ||
variation: VariationSM; | ||
isTouched: boolean; | ||
}; | ||
|
||
const NeedToSaveTooltip: React.FC = () => ( | ||
<ReactTooltipPortal> | ||
<ReactTooltip | ||
clickable | ||
place="bottom" | ||
effect="solid" | ||
delayHide={500} | ||
id="update-screenshot-button-tooltip" | ||
> | ||
Save your work in order to update the screenshot | ||
</ReactTooltip> | ||
</ReactTooltipPortal> | ||
); | ||
|
||
const SideBar: React.FunctionComponent<SideBarProps> = ({ | ||
component, | ||
variation, | ||
isTouched, | ||
}) => { | ||
const { screenshots } = component; | ||
const { openScreenshotsModal } = useScreenshotChangesModal(); | ||
|
||
return ( | ||
<Box> | ||
<Card | ||
bg="headSection" | ||
bodySx={{ p: 0 }} | ||
Footer={() => ( | ||
<> | ||
<Flex | ||
data-tip | ||
data-tip-disable={false} | ||
data-for={"update-screenshot-button-tooltip"} | ||
sx={{ | ||
width: "fit-content", | ||
}} | ||
> | ||
<Button | ||
onClick={openScreenshotsModal} | ||
variant="secondarySmall" | ||
sx={{ fontWeight: "bold" }} | ||
Icon={AiOutlineCamera} | ||
iconFill="#1A1523" | ||
label="Update screenshot" | ||
disabled={isTouched} | ||
/> | ||
</Flex> | ||
{isTouched && <NeedToSaveTooltip />} | ||
</> | ||
)} | ||
footerSx={{ padding: 2 }} | ||
sx={{ overflow: "hidden" }} | ||
> | ||
<ScreenshotPreview | ||
src={screenshots[variation.id]?.url} | ||
sx={{ | ||
height: "198px", | ||
borderBottom: (t) => `1px solid ${t.colors?.borders as string}`, | ||
borderRadius: "4px 4px 0 0", | ||
}} | ||
/> | ||
</Card> | ||
<ScreenshotChangesModal | ||
slices={[component]} | ||
defaultVariationSelector={{ | ||
sliceID: component.model.id, | ||
variationID: variation.id, | ||
}} | ||
/> | ||
</Box> | ||
); | ||
}; | ||
|
||
export default SideBar; |
File renamed without changes.
12 changes: 0 additions & 12 deletions
12
packages/slice-machine/lib/builders/SliceBuilder/SideBar/icons/prismic.svg
This file was deleted.
Oops, something went wrong.
Binary file removed
BIN
-23.1 KB
packages/slice-machine/lib/builders/SliceBuilder/SideBar/icons/sb-logo.png
Binary file not shown.
13 changes: 0 additions & 13 deletions
13
packages/slice-machine/lib/builders/SliceBuilder/SideBar/icons/storybook.svg
This file was deleted.
Oops, something went wrong.
13 changes: 0 additions & 13 deletions
13
packages/slice-machine/lib/builders/SliceBuilder/SideBar/icons/storybookGrey.svg
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.