Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix/716-drep-explorer-visual-defects #871

Merged
merged 2 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 18 additions & 21 deletions govtool/frontend/src/components/atoms/StatusPill.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,40 +5,37 @@ import { DRepStatus } from "@/models";
interface StatusPillProps {
status: DRepStatus;
label?: string;
size?: 'small' | 'medium';
sx?: ChipProps['sx'];
size?: "small" | "medium";
sx?: ChipProps["sx"];
}

export const StatusPill = ({
status,
label = status,
size = 'small',
sx
size = "small",
sx,
}: StatusPillProps) => (
<StyledChip
status={status}
size={size}
label={label}
sx={sx}
/>
<StyledChip status={status} size={size} label={label} sx={sx} />
);

const bgColor = {
[DRepStatus.Active]: successGreen.c200,
[DRepStatus.Inactive]: cyan.c100,
[DRepStatus.Retired]: errorRed.c100,
[DRepStatus.Inactive]: errorRed.c100,
[DRepStatus.Retired]: cyan.c100,
};

const textColor = {
[DRepStatus.Active]: successGreen.c700,
[DRepStatus.Inactive]: cyan.c500,
[DRepStatus.Retired]: errorRed.c500,
[DRepStatus.Inactive]: errorRed.c500,
[DRepStatus.Retired]: cyan.c500,
};

const StyledChip = styled(Chip)<{ status: DRepStatus }>(({ theme, status }) => ({
backgroundColor: bgColor[status],
color: textColor[status],
border: `2px solid ${theme.palette.neutralWhite}`,
fontSize: '0.75rem',
textTransform: 'capitalize',
}));
const StyledChip = styled(Chip)<{ status: DRepStatus }>(
({ theme, status }) => ({
backgroundColor: bgColor[status],
color: textColor[status],
border: `2px solid ${theme.palette.neutralWhite}`,
fontSize: "0.75rem",
textTransform: "capitalize",
}),
);
4 changes: 2 additions & 2 deletions govtool/frontend/src/components/organisms/DRepCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ export const DRepCard = ({
</ButtonBase>
</Box>

<Box display="flex" gap={3}>
<Box>
<Box sx={{ display: "flex", flex: { xl: 1 }, gap: 3 }}>
<Box sx={{ flex: { xl: 1 } }}>
<Typography
variant="caption"
color="textSecondary"
Expand Down
Loading