Skip to content

Commit

Permalink
style:line width 100 (#6073)
Browse files Browse the repository at this point in the history
  • Loading branch information
patrinoua authored Jan 21, 2022
1 parent 14c3165 commit 5225c11
Show file tree
Hide file tree
Showing 869 changed files with 10,605 additions and 3,674 deletions.
16 changes: 8 additions & 8 deletions .secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@
"filename": "src/lib/Scenes/Onboarding/OnboardingLogin.tsx",
"hashed_secret": "788d3735e304fa8e76b78c05be0ac0b3cdf353a9",
"is_verified": false,
"line_number": 178
"line_number": 194
}
],
"src/lib/store/AuthModel.tests.ts": [
Expand All @@ -222,14 +222,14 @@
"filename": "src/lib/store/AuthModel.tests.ts",
"hashed_secret": "54e9af600f3bcfd1153b00430b345fcb68c8efc2",
"is_verified": false,
"line_number": 151
"line_number": 153
},
{
"type": "Secret Keyword",
"filename": "src/lib/store/AuthModel.tests.ts",
"hashed_secret": "bb21216b09d3be2d9e40beab38ae57af2b11d081",
"is_verified": false,
"line_number": 287
"line_number": 297
}
],
"src/lib/utils/PushNotification.tests.ts": [
Expand All @@ -247,30 +247,30 @@
"filename": "src/setupJest.ts",
"hashed_secret": "54e9af600f3bcfd1153b00430b345fcb68c8efc2",
"is_verified": false,
"line_number": 527
"line_number": 530
},
{
"type": "Secret Keyword",
"filename": "src/setupJest.ts",
"hashed_secret": "62befb82f1107014f73b30096000b729a1018601",
"is_verified": false,
"line_number": 528
"line_number": 531
},
{
"type": "Secret Keyword",
"filename": "src/setupJest.ts",
"hashed_secret": "34bac5b688f5b61044c219bbf8d241e52d79c2a6",
"is_verified": false,
"line_number": 535
"line_number": 538
},
{
"type": "Secret Keyword",
"filename": "src/setupJest.ts",
"hashed_secret": "c5110328c5d8a4204c28e7415cf3db6a95239891",
"is_verified": false,
"line_number": 536
"line_number": 539
}
]
},
"generated_at": "2022-01-18T11:24:29Z"
"generated_at": "2022-01-21T11:04:42Z"
}
4 changes: 2 additions & 2 deletions .vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ function! ArtsyIndent()
setlocal shiftwidth=4
setlocal softtabstop=4
setlocal tabstop=4
setlocal textwidth=120
setlocal cc=120
setlocal textwidth=100
setlocal cc=100
endfunction

autocmd Filetype c,cpp,objc call ArtsyIndent()
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"prettier.singleQuote": false,
"prettier.trailingComma": "es5",
"prettier.semi": false,
"prettier.printWidth": 120,
"editor.rulers": [120],
"prettier.printWidth": 100,
"editor.rulers": [100],
"editor.tabSize": 2,
"files.exclude": {
"**/.git": true,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@
]
},
"prettier": {
"printWidth": 120,
"printWidth": 100,
"semi": false,
"singleQuote": false,
"trailingComma": "es5",
Expand Down
9 changes: 7 additions & 2 deletions src/lib/AndroidApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import { GoogleSignin } from "@react-native-google-signin/google-signin"
import { GlobalStore } from "lib/store/GlobalStore"
import { AdminMenuWrapper } from "lib/utils/AdminMenuWrapper"
import { addTrackingProvider, track } from "lib/utils/track"
import { SEGMENT_TRACKING_PROVIDER, SegmentTrackingProvider } from "lib/utils/track/SegmentTrackingProvider"
import {
SEGMENT_TRACKING_PROVIDER,
SegmentTrackingProvider,
} from "lib/utils/track/SegmentTrackingProvider"
import { useDeepLinks } from "lib/utils/useDeepLinks"
import { useStripeConfig } from "lib/utils/useStripeConfig"
import React, { useEffect } from "react"
Expand Down Expand Up @@ -41,7 +44,9 @@ const Main: React.FC<{}> = track()(({}) => {
const isHydrated = GlobalStore.useAppState((state) => state.sessionState.isHydrated)
const isLoggedIn = GlobalStore.useAppState((state) => !!state.auth.userAccessToken)
const onboardingState = GlobalStore.useAppState((state) => state.auth.onboardingState)
const forceUpdateMessage = GlobalStore.useAppState((state) => state.config.echo.forceUpdateMessage)
const forceUpdateMessage = GlobalStore.useAppState(
(state) => state.config.echo.forceUpdateMessage
)

useSentryConfig()
useStripeConfig()
Expand Down
60 changes: 48 additions & 12 deletions src/lib/AppRegistry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ import { MyProfilePaymentQueryRenderer } from "./Scenes/MyProfile/MyProfilePayme
import { MyProfilePaymentNewCreditCard } from "./Scenes/MyProfile/MyProfilePaymentNewCreditCard"
import { MyProfilePushNotificationsQueryRenderer } from "./Scenes/MyProfile/MyProfilePushNotifications"
import { MyProfileSettings } from "./Scenes/MyProfile/MyProfileSettings"
import { NewWorksForYouQueryRenderer, NewWorksForYouScreenQuery } from "./Scenes/NewWorksForYou/NewWorksForYou"
import {
NewWorksForYouQueryRenderer,
NewWorksForYouScreenQuery,
} from "./Scenes/NewWorksForYou/NewWorksForYou"
import { Onboarding } from "./Scenes/Onboarding/Onboarding"
import { OrderDetailsQueryRender } from "./Scenes/OrderHistory/OrderDetails/Components/OrderDetails"
import { OrderHistoryQueryRender } from "./Scenes/OrderHistory/OrderHistory"
Expand All @@ -97,14 +100,20 @@ import { VanityURLEntityRenderer } from "./Scenes/VanityURL/VanityURLEntity"
import { ViewingRoomQueryRenderer } from "./Scenes/ViewingRoom/ViewingRoom"
import { ViewingRoomArtworkScreen } from "./Scenes/ViewingRoom/ViewingRoomArtwork"
import { ViewingRoomArtworksQueryRenderer } from "./Scenes/ViewingRoom/ViewingRoomArtworks"
import { ViewingRoomsListScreen, ViewingRoomsListScreenQuery } from "./Scenes/ViewingRoom/ViewingRoomsList"
import {
ViewingRoomsListScreen,
ViewingRoomsListScreenQuery,
} from "./Scenes/ViewingRoom/ViewingRoomsList"
import { GlobalStore, useSelectedTab } from "./store/GlobalStore"
import { propsStore } from "./store/PropsStore"
import { AdminMenu } from "./utils/AdminMenu"
import { useInitializeQueryPrefetching } from "./utils/queryPrefetching"
import { addTrackingProvider, Schema, screenTrack, track } from "./utils/track"
import { ConsoleTrackingProvider } from "./utils/track/ConsoleTrackingProvider"
import { SEGMENT_TRACKING_PROVIDER, SegmentTrackingProvider } from "./utils/track/SegmentTrackingProvider"
import {
SEGMENT_TRACKING_PROVIDER,
SegmentTrackingProvider,
} from "./utils/track/SegmentTrackingProvider"
import { useExperiments } from "./utils/useExperiments"
import { useFreshInstallTracking } from "./utils/useFreshInstallTracking"
import { usePreferredThemeTracking } from "./utils/usePreferredThemeTracking"
Expand Down Expand Up @@ -145,7 +154,9 @@ interface PartnerLocationsProps {
safeAreaInsets: SafeAreaInsets
isVisible: boolean
}
const PartnerLocations: React.FC<PartnerLocationsProps> = (props) => <PartnerLocationsQueryRenderer {...props} />
const PartnerLocations: React.FC<PartnerLocationsProps> = (props) => (
<PartnerLocationsQueryRenderer {...props} />
)

interface InquiryProps {
artworkID: string
Expand Down Expand Up @@ -177,7 +188,12 @@ interface PageWrapperProps {
moduleName: string
}

const InnerPageWrapper: React.FC<PageWrapperProps> = ({ fullBleed, isMainView, ViewComponent, viewProps }) => {
const InnerPageWrapper: React.FC<PageWrapperProps> = ({
fullBleed,
isMainView,
ViewComponent,
viewProps,
}) => {
const safeAreaInsets = useScreenDimensions().safeAreaInsets
const paddingTop = fullBleed ? 0 : safeAreaInsets.top
const paddingBottom = isMainView ? 0 : safeAreaInsets.bottom
Expand All @@ -191,7 +207,9 @@ const InnerPageWrapper: React.FC<PageWrapperProps> = ({ fullBleed, isMainView, V
}
const isPresentedModally = viewProps.isPresentedModally
return (
<ArtsyKeyboardAvoidingViewContext.Provider value={{ isVisible, isPresentedModally, bottomOffset: paddingBottom }}>
<ArtsyKeyboardAvoidingViewContext.Provider
value={{ isVisible, isPresentedModally, bottomOffset: paddingBottom }}
>
<View style={{ flex: 1, paddingTop, paddingBottom }}>
{isHydrated ? (
<FadeIn style={{ flex: 1 }} slide={false}>
Expand All @@ -209,7 +227,10 @@ class PageWrapper extends React.Component<PageWrapperProps> {
render() {
const props = {
...this.props,
viewProps: { ...this.props.viewProps, ...propsStore.getPropsForModule(this.props.moduleName) },
viewProps: {
...this.props.viewProps,
...propsStore.getPropsForModule(this.props.moduleName),
},
}
return (
<AppProviders>
Expand Down Expand Up @@ -356,12 +377,18 @@ export const modules = defineModules({
MyCollection: reactModule(MyCollectionQueryRenderer),
MyCollectionArtwork: reactModule(MyCollectionArtworkQueryRenderer),
MyCollectionArtworkFullDetails: reactModule(MyCollectionArtworkFullDetailsQueryRenderer),
MyProfile: reactModule(MyProfileQueryRenderer, { isRootViewForTabName: "profile" }, MyProfileScreenQuery),
MyProfile: reactModule(
MyProfileQueryRenderer,
{ isRootViewForTabName: "profile" },
MyProfileScreenQuery
),
MyProfilePayment: reactModule(MyProfilePaymentQueryRenderer),
MyProfileSettings: reactModule(MyProfileSettings),
OrderHistory: reactModule(OrderHistoryQueryRender),
OrderDetails: reactModule(OrderDetailsQueryRender),
MyProfilePaymentNewCreditCard: reactModule(MyProfilePaymentNewCreditCard, { hidesBackButton: true }),
MyProfilePaymentNewCreditCard: reactModule(MyProfilePaymentNewCreditCard, {
hidesBackButton: true,
}),
MyProfilePushNotifications: reactModule(MyProfilePushNotificationsQueryRenderer),
MySellingProfile: reactModule(View),
Partner: reactModule(PartnerQueryRenderer),
Expand All @@ -387,7 +414,11 @@ export const modules = defineModules({
}),
WorksForYou: reactModule(WorksForYouQueryRenderer, {}, WorksForYouScreenQuery),
NewWorksForYou: reactModule(NewWorksForYouQueryRenderer, {}, NewWorksForYouScreenQuery),
LotsByArtistsYouFollow: reactModule(LotsByArtistsYouFollowQueryRenderer, {}, LotsByArtistsYouFollowScreenQuery),
LotsByArtistsYouFollow: reactModule(
LotsByArtistsYouFollowQueryRenderer,
{},
LotsByArtistsYouFollowScreenQuery
),
Storybook: reactModule(StorybookUIRoot, { fullBleed: true, hidesBackButton: true }),
SavedSearchAlertsList: reactModule(SavedSearchAlertsListQueryRenderer),
EditSavedSearchAlert: reactModule(EditSavedSearchAlertQueryRenderer),
Expand All @@ -398,7 +429,10 @@ for (const moduleName of Object.keys(modules)) {
const descriptor = modules[moduleName as AppModule]
if ("Component" in descriptor) {
if (Platform.OS === "ios") {
register(moduleName, descriptor.Component, { fullBleed: descriptor.options.fullBleed, moduleName })
register(moduleName, descriptor.Component, {
fullBleed: descriptor.options.fullBleed,
moduleName,
})
}
}
}
Expand All @@ -417,7 +451,9 @@ const Main: React.FC<{}> = track()(({}) => {
const isLoggedIn = GlobalStore.useAppState((store) => store.auth.userAccessToken)

const onboardingState = GlobalStore.useAppState((state) => state.auth.onboardingState)
const forceUpdateMessage = GlobalStore.useAppState((state) => state.config.echo.forceUpdateMessage)
const forceUpdateMessage = GlobalStore.useAppState(
(state) => state.config.echo.forceUpdateMessage
)

useSentryConfig()
useStripeConfig()
Expand Down
3 changes: 2 additions & 1 deletion src/lib/Components/AnimatableHeader/AnimatableHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ const runTiming = (clock: Clock, value: Animated.Value<number>) => {
export const AnimatableHeader: React.FC<AnimatableHeaderProps> = (props) => {
const { title, rightButtonDisabled, rightButtonText, onRightButtonPress } = props
const { space } = useTheme()
const { scrollOffsetY, headerHeight, largeTitleHeight, largeTitleEndEdge, setTitle } = useAnimatableHeaderContext()
const { scrollOffsetY, headerHeight, largeTitleHeight, largeTitleEndEdge, setTitle } =
useAnimatableHeaderContext()
const clock = useRef(new Animated.Clock()).current
const value = useRef(new Animated.Value(0)).current
const opacity = useRef(runTiming(clock, value)).current
Expand Down
9 changes: 7 additions & 2 deletions src/lib/Components/Artist/ArtistAbout/ArtistAbout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,14 @@ export const ArtistAbout: React.FC<Props> = ({ artist }) => {
mt={2}
/>
)}
{artist.notableWorks?.edges?.length === 3 && <ArtistNotableWorksRailFragmentContainer artist={artist} />}
{artist.notableWorks?.edges?.length === 3 && (
<ArtistNotableWorksRailFragmentContainer artist={artist} />
)}
{!!artist.iconicCollections && artist.iconicCollections.length > 1 && (
<ArtistCollectionsRailFragmentContainer collections={artist.iconicCollections} artist={artist} />
<ArtistCollectionsRailFragmentContainer
collections={artist.iconicCollections}
artist={artist}
/>
)}
<ArtistConsignButton artist={artist} />
<ArtistAboutShowsFragmentContainer artist={artist} />
Expand Down
7 changes: 6 additions & 1 deletion src/lib/Components/Artist/ArtistAbout/ArtistAboutShows.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,12 @@ const ArtistAboutShows: React.FC<Props> = ({ artist }) => {
contentContainerStyle={{ paddingBottom: 15, paddingLeft: 20 }}
/>
{!!pastShows.length && (
<Button variant="fillGray" onPress={() => navigate(`/artist/${artist?.slug!}/shows`)} size="small" block>
<Button
variant="fillGray"
onPress={() => navigate(`/artist/${artist?.slug!}/shows`)}
size="small"
block
>
See all past shows
</Button>
)}
Expand Down
40 changes: 32 additions & 8 deletions src/lib/Components/Artist/ArtistArtworks/ArtistArtworks.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
import { OwnerType } from "@artsy/cohesion"
import { ArtistArtworks_artist } from "__generated__/ArtistArtworks_artist.graphql"
import { ArtworkFilterNavigator, FilterModalMode } from "lib/Components/ArtworkFilter"
import { Aggregations, filterArtworksParams } from "lib/Components/ArtworkFilter/ArtworkFilterHelpers"
import { ArtworkFiltersStoreProvider, ArtworksFiltersStore } from "lib/Components/ArtworkFilter/ArtworkFilterStore"
import {
Aggregations,
filterArtworksParams,
} from "lib/Components/ArtworkFilter/ArtworkFilterHelpers"
import {
ArtworkFiltersStoreProvider,
ArtworksFiltersStore,
} from "lib/Components/ArtworkFilter/ArtworkFilterStore"
import { ORDERED_ARTWORK_SORTS } from "lib/Components/ArtworkFilter/Filters/SortOptions"
import { convertSavedSearchCriteriaToFilterParams } from "lib/Components/ArtworkFilter/SavedSearch/convertersToFilterParams"
import { getAllowedFiltersForSavedSearchInput } from "lib/Components/ArtworkFilter/SavedSearch/searchCriteriaHelpers"
import { SearchCriteriaAttributes } from "lib/Components/ArtworkFilter/SavedSearch/types"
import { useArtworkFilters, useSelectedFiltersCount } from "lib/Components/ArtworkFilter/useArtworkFilters"
import {
useArtworkFilters,
useSelectedFiltersCount,
} from "lib/Components/ArtworkFilter/useArtworkFilters"
import { ArtworksFilterHeader } from "lib/Components/ArtworkGrids/ArtworksFilterHeader"
import { FilteredArtworkGridZeroState } from "lib/Components/ArtworkGrids/FilteredArtworkGridZeroState"
import {
Expand Down Expand Up @@ -71,7 +80,12 @@ const ArtworksGrid: React.FC<ArtworksGridProps> = ({ artist, relay, ...props })
return (
<ArtworkFiltersStoreProvider>
<StickyTabPageScrollView>
<ArtistArtworksContainer {...props} artist={artist} relay={relay} openFilterModal={openFilterArtworksModal} />
<ArtistArtworksContainer
{...props}
artist={artist}
relay={relay}
openFilterModal={openFilterArtworksModal}
/>
<ArtworkFilterNavigator
{...props}
id={artist.internalID}
Expand Down Expand Up @@ -103,7 +117,9 @@ const ArtistArtworksContainer: React.FC<ArtworksGridProps & ArtistArtworksContai
const isEnabledImprovedAlertsFlow = useFeatureFlag("AREnableImprovedAlertsFlow")
const appliedFilters = ArtworksFiltersStore.useStoreState((state) => state.appliedFilters)

const setInitialFilterStateAction = ArtworksFiltersStore.useStoreActions((state) => state.setInitialFilterStateAction)
const setInitialFilterStateAction = ArtworksFiltersStore.useStoreActions(
(state) => state.setInitialFilterStateAction
)

const aggregations = ArtworksFiltersStore.useStoreState((state) => state.aggregations)

Expand All @@ -116,7 +132,8 @@ const ArtistArtworksContainer: React.FC<ArtworksGridProps & ArtistArtworksContai
const artworks = artist.artworks
const artworksCount = artworks?.edges?.length
const artworksTotal = artworks?.counts?.total ?? 0
const shouldShowSavedSearchButton = allowedFiltersForSavedSearch.length > 0 || isEnabledImprovedAlertsFlow
const shouldShowSavedSearchButton =
allowedFiltersForSavedSearch.length > 0 || isEnabledImprovedAlertsFlow

useArtworkFilters({
relay,
Expand All @@ -130,7 +147,9 @@ const ArtistArtworksContainer: React.FC<ArtworksGridProps & ArtistArtworksContai
searchCriteria,
artist.aggregations.aggregations as Aggregations
)
const sortFilterItem = ORDERED_ARTWORK_SORTS.find((sortEntity) => sortEntity.paramValue === "-published_at")
const sortFilterItem = ORDERED_ARTWORK_SORTS.find(
(sortEntity) => sortEntity.paramValue === "-published_at"
)

setInitialFilterStateAction([...params, sortFilterItem!])
}
Expand Down Expand Up @@ -284,7 +303,12 @@ export default createPaginationContainer(
}
},
query: graphql`
query ArtistArtworksQuery($id: ID!, $count: Int!, $cursor: String, $input: FilterArtworksInput) {
query ArtistArtworksQuery(
$id: ID!
$count: Int!
$cursor: String
$input: FilterArtworksInput
) {
node(id: $id) {
... on Artist {
...ArtistArtworks_artist @arguments(count: $count, cursor: $cursor, input: $input)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ describe("Artist Series Rail", () => {
return (
<GlobalStoreProvider>
<Theme>
<ArtistCollectionsRailFragmentContainer collections={props.marketingCollections} {...props} />
<ArtistCollectionsRailFragmentContainer
collections={props.marketingCollections}
{...props}
/>
</Theme>
</GlobalStoreProvider>
)
Expand Down
Loading

0 comments on commit 5225c11

Please sign in to comment.