Create a base `Icon` to derive from when creating icons
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 38/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- react, typescript
Línea de trabajo
Comienza localizando los IconProps y los componentes de iconos existentes en el frontend de Sistent y, después, compara sus variables y constantes compartidas con la implementación propuesta de SistentIcon. Se considera terminado cuando un icono base reutilizable admite children, MUI sx props, color, title y los presets de tamaño definidos, y los iconos duplicados se han refactorizado para usarlo.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Current Behavior
We have multiple icons that needs to be refactored to reduce duplication on variables and constants, and rather rely on one icon to use from.
Desired Behavior
- Create base
SistentIcon - Widen the
IconPropsto includesxprops as an optional field to be used with MUI - Add
sizefield inIconPropsto provide the default sizes forxsmall,small,medium,large, andxlarge
Implementation
The below describes the SistentIcon that will wraps the svg path or else with Box, doesn't have to be box, it can be a div.
The children was changed to allow child elements within the div or Box
export type IconSize = "xsmall" | "small" | "medium" | "large";
export type IconProps = {
children?: React.ReactNode;
color?: string;
title?: string;
width?: number | string;
height?: number | string;
size?: IconSize;
sx?: SxProps<Theme>;
} & Omit<BoxProps, "sx"> &
React.SVGProps<SVGSVGElement>;
const iconSizes: Record<IconSize, { width: number; height: number }> = {
xsmall: { width: 16, height: 16 },
small: { width: 24, height: 24 },
medium: { width: 32, height: 32 },
large: { width: 40, height: 40 },
};
export default function SistentIcon({
color,
title,
size = "medium",
fill = CHARCOAL_FILL,
viewBox,
sx,
children,
...rest
}: IconProps) {
const { width, height } = iconSizes[size];
return (
<Box
component={"svg"}
xmlns="http://www.w3.org/2000/svg"
width={width}
height={height}
viewBox={viewBox}
fill={fill || color}
sx={sx}
{...rest}
>
{title && <title>{title}</title>}
{children}
</Box>
);
}
The fill will be a default color, in this case charcoal. This can be changed inline in project specific. You can also use sx props from MUI in order to use the theme inline.
<IconButton
aria-label="close"
onClick={onClose}
sx={(theme) => ({
"&:hover": {
"& svg": {
fill: theme.palette.keppelGreen,
},
},
})}
disableRipple
>
<CloseIcon
sx={(theme) => ({
fill: theme.palette.charcoal,
})}
/>
</IconButton>
Acceptance Tests
Mockups
- 🎨 Wireframes and designs for Sistent site in Figma (open invite)
- Lenguaje dominante
- TypeScript
- Estrellas
- 140
- Forks
- 243
- Merge medio
- 8 d 17 h
- PR fusionados (30 d)
- 5
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de layer5io/sistent
-
InfoTooltip is not keyboard reachable and has no accessible nameQuizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día
-
[UI] Permission Shield tooltip uses fixed `placement="top"` instead of adaptive placementPosiblemente ocupada @dhruveshmishra la tomó hace 70 días. Abiertocomponent/ui help wanted kind/enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
layer5io/sistent#1772 · 5 comentarios ·
Los mantenedores suelen responder en 1 día
-
Barrel re-exports DateTimePickerProps from the optional peer @mui/x-date-pickers, so the type is `any` for consumers who skip itPosiblemente ocupada @Valyrian-Code la tomó hace 80 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
layer5io/sistent#1749 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
ESM build is not loadable by Node: extensionless 'lodash/debounce' specifier in dist/index.mjsQuizá libre de nuevo @Salmaan-M la tomó hace 85 días y no hay ningún pull request abierto. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
layer5io/sistent#1739 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
[Bug] Modal hardcodes aria-labelledby and aria-describedby pointing to nonexistent element IDsPosiblemente ocupada @PARTH-TUSSLE la tomó hace 4 días. Abiertocomponent/ui kind/bug language/typescript
layer5io/sistent#1864 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de layer5io/sistent
Issues similares
-
fix(frontend): correct VITE_IS_DEVELPOMENT typo in shared/app.ts and align dev environment flagsAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
vicharanashala/ajrasakha#1439 ·
Los mantenedores suelen responder en 1 día
-
Add: TV5Monde AsieAbiertoapproved check:passed streams:add
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
backnotprop/plannotator#1932 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 Medio día Aptitud para principiantes 62/100
ibm-granite/granite.build#504 ·
Los mantenedores suelen responder en 2 días
-
reproduced
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
anomalyco/opencode#55676 · 1 comentario ·
Los mantenedores suelen responder en 1 día