Skip to content

Commit a945d14

Browse files
committed
update docusaurus
1 parent 006093c commit a945d14

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

website/src/pages/index.mdx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -750,10 +750,10 @@ Examples:
750750
751751
```tsx
752752
// ❌ Avoid using enums
753-
enum UserRole {
754-
GUEST = 'guest',
755-
MODERATOR = 'moderator',
756-
ADMINISTRATOR = 'administrator',
753+
enum USER_ROLES {
754+
guest = 'guest',
755+
moderator = 'moderator',
756+
administrator = 'administrator',
757757
}
758758

759759
// ✅ Use const assertions arrays
@@ -783,26 +783,26 @@ Examples:
783783
784784
```ts
785785
// ❌ Avoid using enums
786-
enum Color {
787-
PRIMARY = '#B33930',
788-
SECONDARY = '#113A5C',
789-
BRAND = '#9C0E7D',
786+
enum COLORS {
787+
primary = '#B33930',
788+
secondary = '#113A5C',
789+
brand = '#9C0E7D',
790790
}
791791

792792
// ✅ Use const assertions objects
793-
const COLOR = {
793+
const COLORS = {
794794
primary: '#B33930',
795795
secondary: '#113A5C',
796796
brand: '#9C0E7D',
797797
} as const;
798798

799-
type Color = typeof COLOR;
800-
type ColorKey = keyof Color; // Type "primary" | "secondary" | "brand"
801-
type ColorValue = Color[ColorKey]; // Type "#B33930" | "#113A5C" | "#9C0E7D"
799+
type Colors = typeof COLORS;
800+
type ColorKey = keyof Colors; // Type "primary" | "secondary" | "brand"
801+
type ColorValue = Colors[ColorKey]; // Type "#B33930" | "#113A5C" | "#9C0E7D"
802802

803803
const setColor = (color: ColorValue) => {...
804804

805-
setColor(COLOR.primary);
805+
setColor(COLORS.primary);
806806
setColor('#B33930');
807807
```
808808

0 commit comments

Comments
 (0)