-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore (good-design): bump native-base to latest (#112)
* - 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
Showing
9 changed files
with
199 additions
and
285 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: {} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export * from "./react"; | ||
export * from './react'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'; |
Oops, something went wrong.