Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
TheUltDev committed Apr 19, 2024
1 parent 9a2a556 commit 0460ba4
Show file tree
Hide file tree
Showing 24 changed files with 546 additions and 107 deletions.
3 changes: 2 additions & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"react-native-svg": "^15.1.0",
"react-native-unistyles": "^2.6.0",
"react-native-web": "^0.19.10",
"react-redux": "^9.1.1"
"react-redux": "^9.1.1",
"vite-plugin-node-polyfills": "^0.21.0"
},
"devDependencies": {
"@types/react": "latest",
Expand Down
5 changes: 3 additions & 2 deletions client/src/styles.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {UnistylesRegistry} from 'react-native-unistyles';
import {breakpoints, themes} from 'design/theme';
import {initialTheme, themes, breakpoints} from 'design/theme';

export type AppThemes = {[K in keyof typeof themes]: typeof themes[K]}
export type AppBreakpoints = typeof breakpoints
Expand All @@ -9,5 +9,6 @@ export default UnistylesRegistry
.addThemes(themes)
.addBreakpoints(breakpoints)
.addConfig({
adaptiveThemes: true,
initialTheme,
adaptiveThemes: false,
});
3 changes: 1 addition & 2 deletions design/components/layout/card/Card.docs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ import {Button} from 'vocs/components';
:::

```tsx twoslash
import React from 'react';
// ---cut---
:::twobase:::
// @log: ↓ Import the component
:::import:::

Expand Down
4 changes: 2 additions & 2 deletions design/components/layout/card/Card.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {useStyles, createStyleSheet} from 'react-native-unistyles';
import {useStyles, createStyleSheet} from 'styles';
import {View, Text} from 'react-native';

export interface CardProps {
Expand All @@ -13,7 +13,7 @@ export interface CardProps {
/**
* A simple card block component
* */
export function Card(props: CardProps) {
export function Card(props: CardProps): JSX.Element {
const {styles} = useStyles(stylesheet);

return (
Expand Down
1 change: 1 addition & 0 deletions design/lingui.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {default} from 'config/lingui';
18 changes: 15 additions & 3 deletions design/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,22 @@
"name": "design",
"type": "module",
"private": true,
"scripts": {
"dev": "exo dev --port 6406",
"build": "exo build"
},
"exports": {
".": {
"import": "./index.ts"
"import": "./gen/index.js",
"require": "./gen/index.cjs"
},
"./theme": {
"import": "./theme.ts"
"import": "./gen/theme.js",
"require": "./gen/theme.cjs"
},
"./styles": {
"import": "./gen/styles.js",
"require": "./gen/styles.cjs"
}
},
"dependencies": {
Expand All @@ -21,12 +31,14 @@
"react-native-svg": "^15.1.0",
"react-native-unistyles": "^2.6.0",
"react-native-web": "^0.19.10",
"react-redux": "^9.1.1"
"react-redux": "^9.1.1",
"vite-plugin-node-polyfills": "^0.21.0"
},
"devDependencies": {
"@storybook/react": "^8.0.8",
"@types/react": "latest",
"@types/react-dom": "latest",
"builder": "workspace:*",
"config": "workspace:*",
"typescript": "^5.3.2"
}
Expand Down
14 changes: 14 additions & 0 deletions design/styles.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import {UnistylesRegistry} from 'react-native-unistyles';
import {initialTheme, themes, breakpoints} from 'theme';

export type AppThemes = {[K in keyof typeof themes]: typeof themes[K]}
export type AppBreakpoints = typeof breakpoints

export * from 'react-native-unistyles';
export const registry = UnistylesRegistry
.addThemes(themes)
.addBreakpoints(breakpoints)
.addConfig({
initialTheme,
adaptiveThemes: false,
});
4 changes: 3 additions & 1 deletion design/theme.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export type Themes = keyof typeof themes;

export const breakpoints = {
xs: 0,
sm: 576,
Expand Down Expand Up @@ -304,4 +306,4 @@ export const themes = {
},
}

export default 'light'
export const initialTheme: Themes = 'light'
1 change: 1 addition & 0 deletions design/vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {default} from 'builder/vite.design';
3 changes: 2 additions & 1 deletion library/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,8 @@
"redux": "^5.0.1",
"redux-first-history": "^5.2.0",
"redux-persist": "^6.0.0",
"thumbhash": "^0.1.1"
"thumbhash": "^0.1.1",
"vite-plugin-node-polyfills": "^0.21.0"
},
"devDependencies": {
"@candlefinance/faster-image": "^1.4.3",
Expand Down
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"scripts": {
"start": "conc -c 'auto' 'pnpm:*-dev'",
"build": "conc -c 'auto' -g 'pnpm:*-build'",
"generate": "pnpm config-build && pnpm translate-build && pnpm builder-build && pnpm library-build",
"generate": "pnpm config-build && pnpm translate-build && pnpm builder-build && pnpm library-build && pnpm design-build",

"config-dev": "pnpm --filter ./toolkit/config dev",
"config-build": "pnpm --filter ./toolkit/config build",
Expand All @@ -18,6 +18,10 @@
"library-dev": "pnpm --filter ./library dev",
"library-build": "pnpm --filter ./library build",
"library-publish": "pnpm --filter ./library publish",

"design-dev": "pnpm --filter ./design dev",
"design-build": "pnpm --filter ./design build",
"design-publish": "pnpm --filter ./design publish",

"web-dev": "pnpm --filter ./client run dev",
"web-build": "pnpm --filter ./client run build",
Expand Down
Loading

0 comments on commit 0460ba4

Please sign in to comment.