Skip to content

Commit f0bf4e7

Browse files
committed
Apply Prettier
1 parent 67ad38d commit f0bf4e7

File tree

135 files changed

+108955
-19301
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

135 files changed

+108955
-19301
lines changed

.editorconfig

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
insert_final_newline = true
6+
charset = utf-8
7+
indent_style = space
8+
indent_size = 2

.prettierignore

+1
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ android
44
.vscode
55
ignite/ignite.json
66
package.json
7+
web-build

App.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// This is the first file that ReactNative will run when it starts up.
2-
import App from "./app/app.tsx"
3-
import { registerRootComponent } from "expo"
2+
import App from './app/app.tsx'
3+
import { registerRootComponent } from 'expo'
44

55
registerRootComponent(App)
66
export default App

api.d.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
export type OrgRoamGraphReponse = {
2-
nodes: OrgRoamNode[]
3-
links: OrgRoamLink[]
2+
nodes: OrgRoamNode[]
3+
links: OrgRoamLink[]
44
}
55

66
export type OrgRoamNode = {
7-
id: string
8-
file: string
9-
title: string
7+
id: string
8+
file: string
9+
title: string
1010
}
1111

1212
export type OrgRoamLink = {
13-
source: string
14-
dest: string
13+
source: string
14+
dest: string
1515
}

app.json

+1-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@
1313
"updates": {
1414
"fallbackToCacheTimeout": 0
1515
},
16-
"assetBundlePatterns": [
17-
"**/*"
18-
],
16+
"assetBundlePatterns": ["**/*"],
1917
"ios": {
2018
"supportsTablet": true
2119
},

app/app.tsx

+19-16
Original file line numberDiff line numberDiff line change
@@ -9,30 +9,33 @@
99
* The app navigation resides in ./app/navigators, so head over there
1010
* if you're interested in adding screens and navigators.
1111
*/
12-
import "./i18n"
13-
import "./utils/ignore-warnings"
14-
import React, { useState, useEffect, useRef } from "react"
15-
import { NavigationContainerRef } from "@react-navigation/native"
16-
import { SafeAreaProvider, initialWindowMetrics } from "react-native-safe-area-context"
17-
import { initFonts } from "./theme/fonts" // expo
18-
import * as storage from "./utils/storage"
12+
import './i18n'
13+
import './utils/ignore-warnings'
14+
import React, { useState, useEffect, useRef } from 'react'
15+
import { NavigationContainerRef } from '@react-navigation/native'
16+
import {
17+
SafeAreaProvider,
18+
initialWindowMetrics,
19+
} from 'react-native-safe-area-context'
20+
import { initFonts } from './theme/fonts' // expo
21+
import * as storage from './utils/storage'
1922
import {
2023
useBackButtonHandler,
2124
RootNavigator,
2225
canExit,
2326
setRootNavigation,
2427
useNavigationPersistence,
25-
} from "./navigators"
26-
import { RootStore, RootStoreProvider, setupRootStore } from "./models"
27-
import { ToggleStorybook } from "../storybook/toggle-storybook"
28+
} from './navigators'
29+
import { RootStore, RootStoreProvider, setupRootStore } from './models'
30+
import { ToggleStorybook } from '../storybook/toggle-storybook'
2831

2932
// This puts screens in a native ViewController or Activity. If you want fully native
3033
// stack navigation, use `createNativeStackNavigator` in place of `createStackNavigator`:
3134
// https://github.com/kmagiera/react-native-screens#using-native-stack-navigator
32-
import { enableScreens } from "react-native-screens"
35+
import { enableScreens } from 'react-native-screens'
3336
enableScreens()
3437

35-
export const NAVIGATION_PERSISTENCE_KEY = "NAVIGATION_STATE"
38+
export const NAVIGATION_PERSISTENCE_KEY = 'NAVIGATION_STATE'
3639

3740
/**
3841
* This is the root component of our app.
@@ -43,10 +46,10 @@ function App() {
4346

4447
setRootNavigation(navigationRef)
4548
useBackButtonHandler(navigationRef, canExit)
46-
const { initialNavigationState, onNavigationStateChange } = useNavigationPersistence(
47-
storage,
48-
NAVIGATION_PERSISTENCE_KEY,
49-
)
49+
const {
50+
initialNavigationState,
51+
onNavigationStateChange,
52+
} = useNavigationPersistence(storage, NAVIGATION_PERSISTENCE_KEY)
5053

5154
// Kick off initial async loading actions, like loading fonts and RootStore
5255
useEffect(() => {
+16-10
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,37 @@
11
/* eslint-disable */
2-
import * as React from "react"
3-
import { storiesOf } from "@storybook/react-native"
4-
import { StoryScreen, Story, UseCase } from "../../../storybook/views"
5-
import { AutoImage } from "./auto-image"
2+
import * as React from 'react'
3+
import { storiesOf } from '@storybook/react-native'
4+
import { StoryScreen, Story, UseCase } from '../../../storybook/views'
5+
import { AutoImage } from './auto-image'
66

77
declare let module
88

9-
const bowser = require("../../screens/welcome/bowser.png")
10-
const morty = { uri: "https://rickandmortyapi.com/api/character/avatar/2.jpeg" }
9+
const bowser = require('../../screens/welcome/bowser.png')
10+
const morty = { uri: 'https://rickandmortyapi.com/api/character/avatar/2.jpeg' }
1111

12-
storiesOf("AutoImage", module)
12+
storiesOf('AutoImage', module)
1313
.addDecorator((fn) => <StoryScreen>{fn()}</StoryScreen>)
14-
.add("Style Presets", () => (
14+
.add('Style Presets', () => (
1515
<Story>
1616
<UseCase text="With require()">
1717
<AutoImage source={bowser} />
1818
<AutoImage source={bowser} style={{ width: 150 }} />
1919
<AutoImage source={bowser} style={{ width: 150, height: 150 }} />
2020
<AutoImage source={bowser} style={{ height: 150 }} />
21-
<AutoImage source={bowser} style={{ height: 150, resizeMode: "contain" }} />
21+
<AutoImage
22+
source={bowser}
23+
style={{ height: 150, resizeMode: 'contain' }}
24+
/>
2225
</UseCase>
2326
<UseCase text="With URL">
2427
<AutoImage source={morty} />
2528
<AutoImage source={morty} style={{ width: 150 }} />
2629
<AutoImage source={morty} style={{ width: 150, height: 150 }} />
2730
<AutoImage source={morty} style={{ height: 150 }} />
28-
<AutoImage source={morty} style={{ height: 150, resizeMode: "contain" }} />
31+
<AutoImage
32+
source={morty}
33+
style={{ height: 150, resizeMode: 'contain' }}
34+
/>
2935
</UseCase>
3036
</Story>
3137
))

app/components/auto-image/auto-image.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import React, { useLayoutEffect, useState } from "react"
1+
import React, { useLayoutEffect, useState } from 'react'
22
import {
33
Image as RNImage,
44
ImageProps as DefaultImageProps,
55
ImageURISource,
66
Platform,
7-
} from "react-native"
7+
} from 'react-native'
88

99
type ImageProps = DefaultImageProps & {
1010
source: ImageURISource
@@ -31,7 +31,7 @@ export function AutoImage(props: ImageProps) {
3131
RNImage.getSize(props.source.uri as any, (width, height) => {
3232
setImageSize({ width, height })
3333
})
34-
} else if (Platform.OS === "web") {
34+
} else if (Platform.OS === 'web') {
3535
// web requires a different method to get it's size
3636
RNImage.getSize(props.source as any, (width, height) => {
3737
setImageSize({ width, height })

app/components/bullet-item/bullet-item.tsx

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
import * as React from "react"
2-
import { View, ViewStyle, ImageStyle, TextStyle } from "react-native"
3-
import { Text } from "../text/text"
4-
import { Icon } from "../icon/icon"
5-
import { spacing, typography } from "../../theme"
1+
import * as React from 'react'
2+
import { View, ViewStyle, ImageStyle, TextStyle } from 'react-native'
3+
import { Text } from '../text/text'
4+
import { Icon } from '../icon/icon'
5+
import { spacing, typography } from '../../theme'
66

77
const BULLET_ITEM: ViewStyle = {
8-
flexDirection: "row",
8+
flexDirection: 'row',
99
marginTop: spacing[4],
1010
paddingBottom: spacing[4],
1111
borderBottomWidth: 1,
12-
borderBottomColor: "#3A3048",
12+
borderBottomColor: '#3A3048',
1313
}
1414
const BULLET_CONTAINER: ViewStyle = {
1515
marginRight: spacing[4] - 1,
@@ -22,7 +22,7 @@ const BULLET: ImageStyle = {
2222
const BULLET_TEXT: TextStyle = {
2323
flex: 1,
2424
fontFamily: typography.primary,
25-
color: "#BAB6C8",
25+
color: '#BAB6C8',
2626
fontSize: 15,
2727
lineHeight: 22,
2828
}

app/components/button/button.presets.ts

+10-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { ViewStyle, TextStyle } from "react-native"
2-
import { color, spacing } from "../../theme"
1+
import { ViewStyle, TextStyle } from 'react-native'
2+
import { color, spacing } from '../../theme'
33

44
/**
55
* All text will start off looking like this.
@@ -8,8 +8,8 @@ const BASE_VIEW: ViewStyle = {
88
paddingVertical: spacing[2],
99
paddingHorizontal: spacing[2],
1010
borderRadius: 4,
11-
justifyContent: "center",
12-
alignItems: "center",
11+
justifyContent: 'center',
12+
alignItems: 'center',
1313
}
1414

1515
const BASE_TEXT: TextStyle = {
@@ -34,12 +34,16 @@ export const viewPresets: Record<string, ViewStyle> = {
3434
...BASE_VIEW,
3535
paddingHorizontal: 0,
3636
paddingVertical: 0,
37-
alignItems: "flex-start",
37+
alignItems: 'flex-start',
3838
} as ViewStyle,
3939
}
4040

4141
export const textPresets: Record<ButtonPresetNames, TextStyle> = {
42-
primary: { ...BASE_TEXT, fontSize: 9, color: color.palette.white } as TextStyle,
42+
primary: {
43+
...BASE_TEXT,
44+
fontSize: 9,
45+
color: color.palette.white,
46+
} as TextStyle,
4347
link: {
4448
...BASE_TEXT,
4549
color: color.text,

app/components/button/button.props.ts

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
import { StyleProp, TextStyle, TouchableOpacityProps, ViewStyle } from "react-native"
2-
import { ButtonPresetNames } from "./button.presets"
3-
import { TxKeyPath } from "../../i18n"
1+
import {
2+
StyleProp,
3+
TextStyle,
4+
TouchableOpacityProps,
5+
ViewStyle,
6+
} from 'react-native'
7+
import { ButtonPresetNames } from './button.presets'
8+
import { TxKeyPath } from '../../i18n'
49

510
export interface ButtonProps extends TouchableOpacityProps {
611
/**

app/components/button/button.story.tsx

+31-13
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,48 @@
1-
import * as React from "react"
2-
import { ViewStyle, TextStyle, Alert } from "react-native"
3-
import { storiesOf } from "@storybook/react-native"
4-
import { StoryScreen, Story, UseCase } from "../../../storybook/views"
5-
import { Button } from "./button"
1+
import * as React from 'react'
2+
import { ViewStyle, TextStyle, Alert } from 'react-native'
3+
import { storiesOf } from '@storybook/react-native'
4+
import { StoryScreen, Story, UseCase } from '../../../storybook/views'
5+
import { Button } from './button'
66

77
declare let module
88

9-
const buttonStyleArray: ViewStyle[] = [{ paddingVertical: 100 }, { borderRadius: 0 }]
9+
const buttonStyleArray: ViewStyle[] = [
10+
{ paddingVertical: 100 },
11+
{ borderRadius: 0 },
12+
]
1013

11-
const buttonTextStyleArray: TextStyle[] = [{ fontSize: 20 }, { color: "#a511dc" }]
14+
const buttonTextStyleArray: TextStyle[] = [
15+
{ fontSize: 20 },
16+
{ color: '#a511dc' },
17+
]
1218

13-
storiesOf("Button", module)
19+
storiesOf('Button', module)
1420
.addDecorator((fn) => <StoryScreen>{fn()}</StoryScreen>)
15-
.add("Style Presets", () => (
21+
.add('Style Presets', () => (
1622
<Story>
1723
<UseCase text="Primary" usage="The primary button.">
18-
<Button text="Click It" preset="primary" onPress={() => Alert.alert("pressed")} />
24+
<Button
25+
text="Click It"
26+
preset="primary"
27+
onPress={() => Alert.alert('pressed')}
28+
/>
1929
</UseCase>
20-
<UseCase text="Disabled" usage="The disabled behaviour of the primary button.">
21-
<Button text="Click It" preset="primary" onPress={() => Alert.alert("pressed")} disabled />
30+
<UseCase
31+
text="Disabled"
32+
usage="The disabled behaviour of the primary button."
33+
>
34+
<Button
35+
text="Click It"
36+
preset="primary"
37+
onPress={() => Alert.alert('pressed')}
38+
disabled
39+
/>
2240
</UseCase>
2341
<UseCase text="Array Style" usage="Button with array style">
2442
<Button
2543
text="Click It"
2644
preset="primary"
27-
onPress={() => Alert.alert("pressed")}
45+
onPress={() => Alert.alert('pressed')}
2846
style={buttonStyleArray}
2947
textStyle={buttonTextStyleArray}
3048
/>

app/components/button/button.tsx

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import * as React from "react"
2-
import { TouchableOpacity } from "react-native"
3-
import { Text } from "../text/text"
4-
import { viewPresets, textPresets } from "./button.presets"
5-
import { ButtonProps } from "./button.props"
1+
import * as React from 'react'
2+
import { TouchableOpacity } from 'react-native'
3+
import { Text } from '../text/text'
4+
import { viewPresets, textPresets } from './button.presets'
5+
import { ButtonProps } from './button.props'
66

77
/**
88
* For your text displaying needs.
@@ -12,7 +12,7 @@ import { ButtonProps } from "./button.props"
1212
export function Button(props: ButtonProps) {
1313
// grab the props
1414
const {
15-
preset = "primary",
15+
preset = 'primary',
1616
tx,
1717
text,
1818
style: styleOverride,

app/components/checkbox/checkbox.props.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { StyleProp, ViewStyle } from "react-native"
2-
import { TxKeyPath } from "../../i18n"
1+
import { StyleProp, ViewStyle } from 'react-native'
2+
import { TxKeyPath } from '../../i18n'
33

44
export interface CheckboxProps {
55
/**

0 commit comments

Comments
 (0)