Skip to content

Commit

Permalink
chore (good-design): bump native-base to latest (#112)
Browse files Browse the repository at this point in the history
* - chore (good-design): bump native-base to latest
- chore (good-design): add new font to config

* sdk-v2 dev release

* Dev version beta.ed2172c released

* fix: overflow on input field
  • Loading branch information
L03TJ3 authored Dec 14, 2023
1 parent 5297888 commit be5c9d4
Show file tree
Hide file tree
Showing 9 changed files with 199 additions and 285 deletions.
4 changes: 2 additions & 2 deletions packages/good-design/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"@babel/preset-react": "^7.16.0",
"@babel/preset-typescript": "^7.16.0",
"@babel/runtime": "^7.18.9",
"@gooddollar/web3sdk-v2": "latest",
"@gooddollar/web3sdk-v2": "0.2.10-beta.ed2172c",
"@storybook/addon-actions": "^6.5.12",
"@storybook/addon-essentials": "^6.5.12",
"@storybook/addon-links": "^6.5.12",
Expand Down Expand Up @@ -84,7 +84,7 @@
"metro-react-native-babel-preset": "^0.72.0",
"moment": "^2.29.4",
"moment-duration-format": "^2.3.2",
"native-base": "3.4.11",
"native-base": "^3.4.28",
"prop-types": "^15.8.1",
"react": "17.0.2",
"react-dom": "17.0.2",
Expand Down
4 changes: 2 additions & 2 deletions packages/good-design/src/core/buttons/BasePressable.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Text, Pressable, ITextProps, View, StyledProps, IPressableProps, IButtonProps } from "native-base";
import { Text, Pressable, ITextProps, View, StyledProps, IPressableProps } from "native-base";
import { IViewProps } from "native-base/lib/typescript/components/basic/View/types";
import React from "react";
import { withTheme } from "../../theme/hoc/withTheme";
Expand All @@ -13,7 +13,7 @@ type InterProps = {
[key in interactionEvents]?: InteractionStyles;
};

export interface BasePressableProps extends IPressableProps, Pick<IButtonProps, "variant"> {
export interface BasePressableProps extends IPressableProps {
/**
* a text to be rendered in the component.
*/
Expand Down
1 change: 1 addition & 0 deletions packages/good-design/src/core/web3/Converter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const CurrencyBox = ({ title, placeholder, logoSrc, currencyUnit, onBlur, onChan
variant="unstyled"
onBlur={onBlur}
onChangeText={onChangeText}
overflow="hidden"
/>
<Text>{currencyUnit}</Text>
</CentreBox>
Expand Down
130 changes: 85 additions & 45 deletions packages/good-design/src/theme/fonts.ts
Original file line number Diff line number Diff line change
@@ -1,104 +1,144 @@
import { chain, first, toPairs } from 'lodash';
import { Platform } from 'react-native';
import { chain, first, toPairs } from "lodash";
import { Platform } from "react-native";

export const fontConfig = {
Montserrat: {
100: {
normal: "Montserrat-Thin",
italic: "Montserrat-ThinItalic",
italic: "Montserrat-ThinItalic"
},
200: {
normal: "Montserrat-ExtraLight",
italic: "Montserrat-ExtraLightItalic",
italic: "Montserrat-ExtraLightItalic"
},
300: {
normal: "Montserrat-Light",
italic: "Montserrat-LightItalic",
italic: "Montserrat-LightItalic"
},
400: {
normal: "Montserrat-Regular",
italic: "Montserrat-Italic",
italic: "Montserrat-Italic"
},
500: {
normal: "Montserrat-Medium",
italic: "Montserrat-MediumItalic",
italic: "Montserrat-MediumItalic"
},
600: {
normal: "Montserrat-SemiBold",
italic: "Montserrat-SemiBoldItalic",
italic: "Montserrat-SemiBoldItalic"
},
700: {
normal: 'Montserrat-Bold',
italic: 'Montserrat-BoldItalic',
normal: "Montserrat-Bold",
italic: "Montserrat-BoldItalic"
},
800: {
normal: 'Montserrat-ExtraBold',
italic: 'Montserrat-ExtraBoldItalic',
normal: "Montserrat-ExtraBold",
italic: "Montserrat-ExtraBoldItalic"
},
900: {
normal: 'Montserrat-Black',
italic: 'Montserrat-BlackItalic',
},
normal: "Montserrat-Black",
italic: "Montserrat-BlackItalic"
}
},
Roboto: {
100: {
normal: 'Roboto-Thin',
italic: 'Roboto-ThinItalic',
normal: "Roboto-Thin",
italic: "Roboto-ThinItalic"
},
200: {
normal: 'Roboto-Thin',
italic: 'Roboto-ThinItalic',
normal: "Roboto-Thin",
italic: "Roboto-ThinItalic"
},
300: {
normal: 'Roboto-Light',
italic: 'Roboto-LightItalic',
normal: "Roboto-Light",
italic: "Roboto-LightItalic"
},
400: {
normal: 'Roboto-Regular',
italic: 'Roboto-Italic',
normal: "Roboto-Regular",
italic: "Roboto-Italic"
},
500: {
normal: 'Roboto-Medium',
italic: 'Roboto-MediumItalic',
normal: "Roboto-Medium",
italic: "Roboto-MediumItalic"
},
600: {
normal: 'Roboto-Medium',
italic: 'Roboto-MediumItalic',
normal: "Roboto-Medium",
italic: "Roboto-MediumItalic"
},
700: {
normal: 'Roboto-Bold',
italic: 'Roboto-BoldItalic',
normal: "Roboto-Bold",
italic: "Roboto-BoldItalic"
},
800: {
normal: 'Roboto-Bold',
italic: 'Roboto-BoldItalic',
normal: "Roboto-Bold",
italic: "Roboto-BoldItalic"
},
900: {
normal: 'Roboto-Black',
italic: 'Roboto-BlackItalic',
},
normal: "Roboto-Black",
italic: "Roboto-BlackItalic"
},
Inter: {
100: {
normal: "Inter-Thin",
italic: "Inter-ThinItalic"
},
200: {
normal: "Inter-ExtraLight",
italic: "Inter-ExtraLightItalic"
},
300: {
normal: "Inter-Light",
italic: "Inter-LightItalic"
},
400: {
normal: "Inter-Regular",
italic: "Inter-Italic"
},
500: {
normal: "Inter-Medium",
italic: "Inter-MediumItalic"
},
600: {
normal: "Inter-SemiBold",
italic: "Inter-SemiBoldItalic"
},
700: {
normal: "Inter-Bold",
italic: "Inter-BoldItalic"
},
800: {
normal: "Inter-ExtraBold",
italic: "Inter-ExtraBoldItalic"
},
900: {
normal: "Inter-Black",
italic: "Inter-BlackItalic"
}
}
}
};

export type FontID = Lowercase<keyof typeof fontConfig>;

export const pickWeight = (list: any[], style: 'normal' | 'italic') => chain(list)
.groupBy(style)
.mapValues(items => Number(first(items).weight))
.values()
.value();
export const pickWeight = (list: any[], style: "normal" | "italic") =>
chain(list)
.groupBy(style)
.mapValues(items => Number(first(items).weight))
.values()
.value();

export const getFamiliesUrl = (families: Record<string, any>, fontName: string) => {
const list = toPairs(families).map(([weight, props]: [string, any]) => ({ weight, ...props }));

const [normalWeights, italicWeights] = ["normal", "italic"]
.map(style => pickWeight(list, style as 'normal' | 'italic'))
.map(style => pickWeight(list, style as "normal" | "italic"))
.map((weights, index) => weights.map(value => `${index},${value}`).join(";"));

return `//fonts.googleapis.com/css2?family=${fontName}:ital,wght@${normalWeights};${italicWeights}&display=swap`
return `//fonts.googleapis.com/css2?family=${fontName}:ital,wght@${normalWeights};${italicWeights}&display=swap`;
};

export const getPlatformFamilies = (families: typeof fontConfig) => Platform.select<Partial<typeof fontConfig>>({
native: families,
default: {}
});
export const getPlatformFamilies = (families: typeof fontConfig) =>
Platform.select<Partial<typeof fontConfig>>({
native: families,
default: {}
});
3 changes: 2 additions & 1 deletion packages/good-design/src/theme/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export * from "./theme";
export * from "./hoc";
export * from "./utils";
export * from "./NativeBaseProvider";
export * from "./NativeBaseProvider";
export * from "./fonts";
4 changes: 2 additions & 2 deletions packages/login-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gooddollar/goodlogin-sdk",
"version": "1.1.32",
"version": "1.1.33-beta.751faa8",
"description": "Login SDK for login with Gooddollar wallet",
"scripts": {
"build": "tsc",
Expand All @@ -19,7 +19,7 @@
"devDependencies": {
"@babel/core": "^7.17.5",
"@babel/preset-env": "^7.16.11",
"@gooddollar/web3sdk-v2": "0.1.55",
"@gooddollar/web3sdk-v2": "0.2.10-beta.751faa8",
"@testing-library/react": "^12.1.4",
"@types/jest": "^27.4.1",
"@types/node": "^17.0.21",
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk-v2/src/sdk/buygd/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from "./react";
export * from './react';
24 changes: 12 additions & 12 deletions packages/sdk-v2/src/sdk/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
export * from "./analytics";
export * from "./base";
export * from "./buygd";
export * from "./claim";
export * from "./constants";
export * from "./faucet";
export * from "./ipfs";
export * from "./microbridge";
export * from "./newsfeed";
export * from "./onboard";
export * from "./savings";
export * from "./storage";
export * from './analytics';
export * from './base';
export * from './buygd';
export * from './claim';
export * from './constants';
export * from './faucet';
export * from './ipfs';
export * from './microbridge';
export * from './newsfeed';
export * from './onboard';
export * from './savings';
export * from './storage';
Loading

0 comments on commit be5c9d4

Please sign in to comment.