Skip to content

Commit

Permalink
copy of 'new components pr' (#1894)
Browse files Browse the repository at this point in the history
copied from #1890

---------

Co-authored-by: or orsatti <[email protected]>
Co-authored-by: Amir Angel <[email protected]>
Co-authored-by: GuySerfaty <[email protected]>
  • Loading branch information
4 people authored and rrrliu committed Sep 27, 2024
1 parent 6eadde6 commit 5dc964d
Show file tree
Hide file tree
Showing 79 changed files with 1,482 additions and 75 deletions.
2 changes: 1 addition & 1 deletion apps/passport-client/components/screens/AddEmailScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ export function AddEmailScreen(): JSX.Element | null {
return (
<>
<MaybeModal />
<AppContainer bg="gray">
<AppContainer bg="primary">
<Spacer h={64} />
<CenterColumn>{content}</CenterColumn>
</AppContainer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export function AddScreen(): JSX.Element | null {

if (!screen) {
// Need AppContainer to display error
return <AppContainer bg="gray" />;
return <AppContainer bg="primary" />;
}
return screen;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export function JustAddScreen({
<>
{isProtocolWorlds && <ProtocolWorldsStyling />}
<MaybeModal fullScreen isProveOrAddScreen={true} />
<AppContainer bg="gray">
<AppContainer bg="primary">
<Container>
<Spacer h={16} />
<AppHeader isProveOrAddScreen={true} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export function ProveAndAddScreen({
return (
<>
<MaybeModal fullScreen isProveOrAddScreen={true} />
<AppContainer bg="gray">
<AppContainer bg="primary">
<Container>
<Spacer h={24} />
<AppHeader isProveOrAddScreen={true}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ export function AddSubscriptionScreen(): JSX.Element | null {
return (
<>
<MaybeModal />
<AppContainer bg="gray">
<AppContainer bg="primary">
<ScreenNavigation label={"Subscriptions"} to="/subscriptions" />
<SubscriptionsScreenContainer>
{mismatchedEmails && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ export function ChangeEmailScreen(): JSX.Element | null {
return (
<>
<MaybeModal />
<AppContainer bg="gray">
<AppContainer bg="primary">
<Spacer h={64} />
<CenterColumn>{content}</CenterColumn>
</AppContainer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ export function ChangePasswordScreen(): JSX.Element | null {
return (
<>
<MaybeModal />
<AppContainer bg="gray">
<AppContainer bg="primary">
<Spacer h={64} />
<CenterColumn>{content}</CenterColumn>
</AppContainer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export function EmbeddedGPCProofScreen({
const identity = useIdentityV3();

return (
<AppContainer bg="gray">
<AppContainer bg="primary">
<Spacer h={4} />
<H2
style={{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export function FrogManagerScreen(): JSX.Element {
}

return (
<AppContainer bg="gray">
<AppContainer bg="primary">
<ButtonGroup>
<Button
disabled={tab === "frogs"}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export function FrogSubscriptionScreen(): JSX.Element {
}

return (
<AppContainer bg="gray">
<AppContainer bg="primary">
<Container>
<TypistText
onInit={(typewriter): TypewriterClass =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export function GetWithoutProvingScreen(): JSX.Element | null {
return (
<>
<MaybeModal fullScreen isProveOrAddScreen={true} />
<AppContainer bg="gray">
<AppContainer bg="primary">
<Container>
<Spacer h={16} />
<AppHeader isProveOrAddScreen={true} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,12 @@ export function AddHaloScreen({
let content: ReactNode;

if (invalidPCD) {
return <AppContainer bg="gray" />;
return <AppContainer bg="primary" />;
} else if (!pcd) {
return <SyncingPCDs />;
} else if (!loggedIn) {
return (
<AppContainer bg="gray">
<AppContainer bg="primary">
<MaybeModal fullScreen />
<Container>
<Spacer h={16} />
Expand Down Expand Up @@ -139,7 +139,7 @@ export function AddHaloScreen({
}

return (
<AppContainer bg="gray">
<AppContainer bg="primary">
<MaybeModal fullScreen />
<Container>
<Spacer h={16} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ export function HaloScreen(): JSX.Element {

if (!syncSettled) {
return (
<AppContainer bg="gray">
<AppContainer bg="primary">
<SyncingPCDs />
</AppContainer>
);
}

if (!screen) {
// Need AppContainer to display error
return <AppContainer bg="gray" />;
return <AppContainer bg="primary" />;
}

return screen;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ export function HomeScreenImpl(): JSX.Element | null {
return (
<>
<MaybeModal />
<AppContainer bg="gray">
<AppContainer bg="primary">
<Spacer h={24} />
<AppHeader isEdgeCity={isEdgeCity} />
<Spacer h={24} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ export function ImportBackupScreen(): JSX.Element {
return (
<>
<MaybeModal />
<AppContainer bg="gray">
<AppContainer bg="primary">
<ScreenNavigation label={"Home"} to="/" />
<Container>
<Spacer h={8} />
Expand Down
2 changes: 1 addition & 1 deletion apps/passport-client/components/screens/MissingScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export function MissingScreen(): JSX.Element {
const loc = useLocation();

return (
<AppContainer bg="gray">
<AppContainer bg="primary">
<CenterColumn w={290}>
<TextCenter>
<Spacer h={64} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export function GenericProveScreen({
return (
<>
<MaybeModal fullScreen isProveOrAddScreen={true} />
<AppContainer bg="gray">
<AppContainer bg="primary">
<AppHeader isProveOrAddScreen={true}>
<H2
style={{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ export function ProveScreen(): JSX.Element | null {

if (!syncSettled) {
return (
<AppContainer bg="gray">
<AppContainer bg="primary">
<SyncingPCDs />
</AppContainer>
);
}

if (!screen) {
// Need AppContainer to display error
return <AppContainer bg="gray" />;
return <AppContainer bg="primary" />;
}

return screen;
Expand Down Expand Up @@ -101,7 +101,7 @@ function getScreen(request: PCDGetRequest): JSX.Element | null {
return (
<>
<MaybeModal fullScreen isProveOrAddScreen={true} />
<AppContainer bg="gray">
<AppContainer bg="primary">
<Spacer h={24} />
<H2>{title.toUpperCase()}</H2>
<Spacer h={24} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ export function RemoveEmailScreen(): JSX.Element | null {
return (
<>
<MaybeModal />
<AppContainer bg="gray">
<AppContainer bg="primary">
<Spacer h={64} />
<CenterColumn>{content}</CenterColumn>
</AppContainer>
Expand Down
4 changes: 2 additions & 2 deletions apps/passport-client/components/screens/ScanScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ export function ScanScreen(): JSX.Element {

if (isRedirectingProtocolWorlds) {
return (
<AppContainer bg="gray">
<AppContainer bg="primary">
<ScreenLoader text="Discovering something new.." />
</AppContainer>
);
}

return (
<AppContainer bg="gray">
<AppContainer bg="primary">
{!usingLaserScanner && (
<QRContainer>
<Spacer h={8} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export function ServerErrorScreen(): JSX.Element {
const description = query.get("description");

return (
<AppContainer bg="gray">
<AppContainer bg="primary">
<CenterColumn w={290}>
<TextCenter>
<Spacer h={64} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export function SubscriptionsScreen(): JSX.Element {
<>
<MaybeModal />
<Overscroll />
<AppContainer bg="gray">
<AppContainer bg="primary">
<ScreenNavigation label={"Home"} to="/" />
<Spacer h={8} />
<Button onClick={onAddNewClicked}>Add Subscription</Button>
Expand Down
8 changes: 5 additions & 3 deletions apps/passport-client/components/shared/AppContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import { ScreenLoader } from "./ScreenLoader";

// Wrapper for all screens.
export function AppContainer({
children
children,
bg
}: {
bg: "primary" | "gray";
children?: ReactNode;
Expand All @@ -25,7 +26,8 @@ export function AppContainer({
[dispatch]
);

const col = "var(--bg-dark-primary)";
const col =
bg === "gray" ? "var(--dot-pattern-bg)" : "var(--bg-dark-primary)";
return (
<>
<GlobalBackground color={col} />
Expand Down Expand Up @@ -53,7 +55,7 @@ export function AppContainer({

export const GlobalBackground = createGlobalStyle<{ color: string }>`
html {
background-color: ${(p): string => p.color};
background: ${(p): string => p.color};
}
`;

Expand Down
Loading

0 comments on commit 5dc964d

Please sign in to comment.