Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 | 1x 1x 1x 1x 1x | import { Stack, Box, Grid } from "@mui/material";
import Skeleton from "@components/animation/Skeleton";
import { GiveBrandingHeading } from "./components/GiveBrandingComponents";
import GiveText from "@shared/Text/GiveText";
import GiveDivider from "@shared/GiveDivider/GiveDivider";
import GiveMotionWrapper from "@shared/Motion/GiveMotionWrapper";
import { HiddenComponent } from "@containers/HiddenComponent";
import GiveCustomColorCircle from "./components/GiveCustomColorCircle";
import TaskCard from "@features/Merchants/MerchantSidePanel/UnderwritingTasks/components/TaskCard";
import { useCustomThemeV2 } from "@theme/hooks/useCustomThemeV2";
import { brandingHeadings, getTooltipContent } from "./constants";
import { styled, useAppTheme } from "@theme/v2/Provider";
import GiveIconButton from "@shared/IconButton/GiveIconButton";
import { CopyIcon, InfoIcon } from "@phosphor-icons/react";
import GiveTooltip from "@shared/Tooltip/GiveTooltip";
const ACTION_BAR_HEIGHT = "68px";
const colorChoices = [
{ title: "Ocean Blue" },
{ title: "Citrus Peel" },
{ title: "Moon Purple" },
{ title: "Custom", isCustom: true },
];
const GiveBrandingSkeleton = () => {
const { isMobileView } = useCustomThemeV2();
const { palette } = useAppTheme();
const tooltipContent = getTooltipContent(true);
const sections = [
{
node: (
<Stack
direction={isMobileView ? "column" : "row"}
gap="24px"
flexGrow={1}
>
<GiveBrandingHeading {...brandingHeadings["logo"]} />
<Box display="flex" gap="8px" alignItems="center">
<Skeleton width={164} height={72} borderRadius="12px" />
<Skeleton width={72} height={72} borderRadius="12px" />
</Box>
</Stack>
),
withDivider: true,
},
{
node: (
<Stack direction="column" gap="16px" alignItems="stretch">
<GiveBrandingHeading {...brandingHeadings["cards"]} />
<GiveText variant="bodyM" color="secondary" mt={2}>
Accent
</GiveText>
<Grid container rowGap={1} columnSpacing={1}>
{colorChoices.map((card, index) => (
<Grid item xs={12} sm={6} md={6} lg={3} key={card.title + index}>
<CardContainer palette={palette}>
<Stack direction="row" alignItems="center" gap="12px">
{card.isCustom ? (
<GiveCustomColorCircle isSelected={false} />
) : (
<Skeleton
variant="circular"
width={32}
height={32}
borderRadius="50%"
/>
)}
<GiveText variant="bodyS" color="secondary">
{card.title}
</GiveText>
</Stack>
</CardContainer>
</Grid>
))}
</Grid>
</Stack>
),
withDivider: isMobileView,
},
{
node: (
<Box mb={2}>
<Skeleton width="100%" height={200} borderRadius="12px" />
</Box>
),
hidden: isMobileView,
withDivider: true,
},
{
node: (
<Stack direction="column" gap="16px" alignItems="stretch">
<GiveBrandingHeading
{...brandingHeadings["iframe"]}
action={
<GiveTooltip
color="default"
title={tooltipContent}
placement="top"
alignment="center"
customTooltipStyles={{
maxWidth: "350px",
}}
fluidWidth
>
<InfoIcon
data-testid="embed-code-info-icon"
size={20}
color={palette.icon?.["icon-secondary"]}
style={{
cursor: "pointer",
}}
/>
</GiveTooltip>
}
/>
<TaskCard
title="iFrame"
actions={[
{
element: (
<GiveTooltip title="Copy Code">
<GiveIconButton
variant="ghost"
size="small"
Icon={CopyIcon}
onClick={() => {}}
data-testid="copy-code-button"
disabled
/>
</GiveTooltip>
),
},
]}
>
<Stack spacing={0.5}>
<Skeleton width="100%" height={16} borderRadius="4px" />
<Skeleton width="50%" height={16} borderRadius="4px" />
</Stack>
</TaskCard>
</Stack>
),
withDivider: false,
},
];
return (
<Stack
direction="column"
gap="50px"
paddingBottom={ACTION_BAR_HEIGHT}
alignItems="stretch"
overflow="hidden"
>
<Stack direction="column" gap="32px" alignItems="stretch" flexGrow={1}>
{sections.map(({ node, hidden, withDivider }, index) => (
<HiddenComponent key={index} hidden={hidden || false}>
<>
<GiveMotionWrapper delay={50 + 70 * index}>
<>
{node}
{withDivider && <GiveDivider bgType="transparent" my={0} />}
</>
</GiveMotionWrapper>
</>
</HiddenComponent>
))}
</Stack>
</Stack>
);
};
const CardContainer = styled(Box, {
shouldForwardProp: (prop) => prop !== "palette",
})<{
palette: any;
}>(({ palette }) => ({
cursor: "default",
padding: "16px",
borderRadius: "8px",
display: "flex",
flexDirection: "row",
alignItems: "center",
backgroundColor: palette.background?.paper || "#FFFFFF",
border: `1px solid ${palette.border?.secondary}`,
pointerEvents: "none",
}));
export default GiveBrandingSkeleton;
|