Skip to content

Commit

Permalink
Merge branch 'main' into main-fix-ios-scroll
Browse files Browse the repository at this point in the history
  • Loading branch information
redreceipt authored Apr 6, 2024
2 parents a539927 + 1b68436 commit ed93abe
Show file tree
Hide file tree
Showing 34 changed files with 11,834 additions and 329,869 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,13 @@ jobs:
with:
registry-url: https://registry.npmjs.org/

- name: Yarn Install
run: yarn
working-directory: web-embeds

- name: Deploy to NPM
run: npm run bump
run: yarn bump
working-directory: web-embeds
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
YARN_REGISTRY: https://registry.npmjs.org/
28 changes: 8 additions & 20 deletions micro-service/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import {
RouterProvider,
} from '@apollosproject/web-shared/providers';

import AppHeader from '@apollosproject/web-shared/components/AppHeader';

import { Button, Box, BodyText } from '@apollosproject/web-shared/ui-kit';
import { Logo } from '@apollosproject/web-shared/components';
import { useCurrentChurch } from '@apollosproject/web-shared/hooks';
import Styled from './App.styles';

import ErrorPage from './error-page';
Expand All @@ -24,20 +24,6 @@ Sentry.init({
tracesSampleRate: 1.0,
});

function ChurchLogo(props) {
const { currentChurch } = useCurrentChurch();

//Can't set favicon in SSR
if (typeof document !== 'undefined') {
const favicon = document.querySelector('link[rel="icon"]');
if (currentChurch?.logo) {
favicon.href = currentChurch.logo;
}
}

return <Logo source={currentChurch?.logo} {...props} />;
}

function App({ searchParams, url }) {
const churchSlug = getChurchSlug(url);
const _root = searchParams?.root;
Expand All @@ -47,9 +33,12 @@ function App({ searchParams, url }) {
const ssr = typeof document === 'undefined';

const mainRoute = (
<Styled.FeedWrapper>
<FeatureFeed featureFeed={`${type}:${randomId}`} church={churchSlug} />
</Styled.FeedWrapper>
<>
<AppHeader />
<Styled.FeedWrapper>
<FeatureFeed featureFeed={`${type}:${randomId}`} church={churchSlug} />
</Styled.FeedWrapper>
</>
);

const routerConfig = [
Expand All @@ -66,7 +55,6 @@ function App({ searchParams, url }) {
if (churchSlug) {
return (
<AppProvider church={churchSlug} modal="true">
<ChurchLogo display="flex" alignItems="center" justifyContent="center" marginTop="40px" />
{/** When using SSR, avoid the router. it crashes */}
{ssr ? mainRoute : <RouterProvider router={router} />}
</AppProvider>
Expand Down
12 changes: 9 additions & 3 deletions micro-service/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@ html {
html,
body {
height: 100%;
font-family: 'Inter', -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen,
Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
background-color: #f8f8fa;
}

* {
font-family: 'Inter', -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu,
Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
}

img {
Expand All @@ -36,4 +40,6 @@ input:focus-visible {
outline: none;
}

::selection { background: rgba(110,197,184, 0.62); /* base.tertiary */ }
::selection {
background: rgba(110, 197, 184, 0.62); /* base.tertiary */
}
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
"license": "MIT",
"workspaces": {
"packages": [
"packages/*"
"packages/*",
"micro-service",
"web-embeds"
],
"nohoist": []
}
Expand Down
46 changes: 46 additions & 0 deletions packages/web-shared/components/AppHeader/AppHeader.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import Wordmark from '../Wordmark';
import { useCurrentChurch } from '../../hooks';
import { Box, Avatar } from '../../ui-kit';
import { User } from '@phosphor-icons/react';

import SearchStyles from '../Searchbar/Search.styles';

import ProfileButton from '../Profile/ProfileButton';

function ChurchLogo(props) {
const { currentChurch } = useCurrentChurch();

return <Wordmark source={currentChurch?.wordmarkLightUrl} padding={10} {...props} />;
}

const AppHeader = () => (
<>
<Box
py={8}
px={16}
height={58}
alignItems="center"
backgroundColor="fill.paper"
borderBottom="1px solid"
borderColor="text.quaternary"
position="fixed"
display="flex"
flexDirection="row"
justifyContent="space-between"
boxShadow="small"
top={0}
left={0}
right={0}
zIndex={999}
>
<Box>
<ChurchLogo size="30px" />
</Box>

<ProfileButton />
</Box>
<Box height={58} />
</>
);

export default AppHeader;
3 changes: 3 additions & 0 deletions packages/web-shared/components/AppHeader/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import AppHeader from './AppHeader';

export default AppHeader;
7 changes: 4 additions & 3 deletions packages/web-shared/components/Auth/AuthConfirm.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import AuthLayout from './AuthLayout';
import authSteps from './authSteps';
import { useAnalytics } from '../../providers/AnalyticsProvider';

const AuthConfirm = () => {
const AuthConfirm = (props) => {
const [status, setStatus] = useState('IDLE');
const [error, setError] = useState(null);
const [state, dispatch] = useAuth();
Expand Down Expand Up @@ -63,7 +63,7 @@ const AuthConfirm = () => {
email: user?.email,
phone: user?.phone,
numberOfSharedProfiles: sharedProfiles.length,
});
});
dispatch(
updateAuth({
token,
Expand All @@ -77,7 +77,7 @@ const AuthConfirm = () => {
userId: user?.id,
email: user?.email,
phone: user?.phone,
});
});
if (needsOnboarding) {
dispatch(
updateAuth({
Expand Down Expand Up @@ -130,6 +130,7 @@ const AuthConfirm = () => {

return (
<AuthLayout
{...props}
heading="We sent you a code..."
subHeading={`Verify the code we sent to your ${state.type === 'email' ? 'email' : 'phone'}.`}
>
Expand Down
10 changes: 3 additions & 7 deletions packages/web-shared/components/Auth/AuthDetails.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import React, { useState, useEffect } from 'react';

import {
useForm,
useUpdateProfileFields,
useCurrentUser,
useCompleteRegister,
} from '../../hooks';
import { useForm, useUpdateProfileFields, useCurrentUser, useCompleteRegister } from '../../hooks';
import { update as updateAuth, useAuth } from '../../providers/AuthProvider';
import { Box, Button, Input, Select } from '../../ui-kit';
import authSteps from '../Auth/authSteps';
Expand All @@ -16,7 +11,7 @@ function upperFirst(string) {
return string.charAt(0).toUpperCase() + string.slice(1);
}

function AuthDetails() {
function AuthDetails(props) {
const [status, setStatus] = useState('IDLE');
const [error, setError] = useState(null);
const [user, setUser] = useState(null);
Expand Down Expand Up @@ -61,6 +56,7 @@ function AuthDetails() {

return (
<AuthLayout
{...props}
heading="Complete your profile"
subHeading="Help us learn a little more about you so we can connect you with the
best ministries and events."
Expand Down
11 changes: 4 additions & 7 deletions packages/web-shared/components/Auth/AuthIdentity.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Button, Input, SmallSystemText, Box } from '../../ui-kit';
import { validateEmail, validatePhoneNumber } from '../../utils';
import AuthLayout from './AuthLayout';

const AuthIdentity = () => {
const AuthIdentity = (props) => {
const [status, setStatus] = useState('IDLE');
const [error, setError] = useState(null);
const [state, dispatch] = useAuth();
Expand Down Expand Up @@ -72,9 +72,7 @@ const AuthIdentity = () => {
setStatus('LOADING');
requestLogin({
variables: {
identity: validEmail
? { email: values.identity }
: { phone: values.identity },
identity: validEmail ? { email: values.identity } : { phone: values.identity },
},
});
} else {
Expand All @@ -87,9 +85,8 @@ const AuthIdentity = () => {

return (
<AuthLayout
heading={
state.type === 'login' ? 'Welcome back!' : 'We’re glad you’re here.'
}
{...props}
heading={state.type === 'login' ? 'Welcome back!' : 'We’re glad you’re here.'}
subHeading={
state.type === 'login'
? 'Use the same phone number or email that you used when logging into the app before.'
Expand Down
16 changes: 14 additions & 2 deletions packages/web-shared/components/Auth/AuthLayout/AuthLayout.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
import { CaretLeft } from '@phosphor-icons/react';
import { CaretLeft, X } from '@phosphor-icons/react';

import { Box, Card, Button } from '../../../ui-kit';
import customizations from './customizations';
Expand Down Expand Up @@ -47,7 +47,19 @@ function AuthLayout(props = {}) {
flexDirection="row-reverse"
icon={<CaretLeft />}
/>
) : null}
) : (
<Button
variant="link"
title="Close"
onClick={props.onClose}
alignSelf="flex-end"
color="text.action"
alignItems="center"
display="flex"
flexDirection="row-reverse"
icon={<X />}
/>
)}
<Heading>{props.heading || customizations.defaulthHeading}</Heading>
<SubHeading>{props.subHeading || customizations.defaultSubHeading}</SubHeading>
{props.children}
Expand Down
12 changes: 6 additions & 6 deletions packages/web-shared/components/Auth/AuthManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,25 @@ function AuthManager(props = {}) {
const render = () => {
switch (step) {
case authSteps.Welcome: {
return <Welcome />;
return <Welcome {...props} />;
}
case authSteps.Identity: {
return <Identity />;
return <Identity {...props} />;
}
case authSteps.Details: {
return <Details />;
return <Details {...props} />;
}
case authSteps.Merge: {
return <Merge />;
return <Merge {...props} />;
}
case authSteps.Confirm: {
return <Confirm />;
return <Confirm {...props} />;
}
case authSteps.Success: {
return null;
}
default: {
return <Welcome />;
return <Welcome {...props} />;
}
}
};
Expand Down
4 changes: 2 additions & 2 deletions packages/web-shared/components/Auth/AuthWelcome.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ import { Box, Button } from '../../ui-kit';
import AuthLayout from './AuthLayout';
import steps from './authSteps';

const AuthWelcome = () => {
const AuthWelcome = (props) => {
const [state, dispatch] = useAuth();

const handleSubmit = async ({ step, type }) => {
dispatch(updateAuth({ step, type }));
};

return (
<AuthLayout>
<AuthLayout {...props}>
<Box flexDirection="row">
<Button
mr="base"
Expand Down
Loading

0 comments on commit ed93abe

Please sign in to comment.