Skip to content

Commit

Permalink
Merge pull request #1993 from daostack/staging
Browse files Browse the repository at this point in the history
Sprint 26
  • Loading branch information
MeyerPV authored Aug 17, 2023
2 parents 4f82ac1 + 00cead4 commit 9e32e99
Show file tree
Hide file tree
Showing 192 changed files with 2,558 additions and 629 deletions.
16 changes: 8 additions & 8 deletions src/config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,16 @@ const dev: Configuration = {
const stage: Configuration = {
env: Environment.Stage,
firebase: {
apiKey: "AIzaSyClh8UZh-PDyVgwPrHZwURoA4HWuiXUbR8",
authDomain: "auth-staging.common.io",
databaseURL: "https://common-staging-50741.firebaseio.com",
projectId: "common-staging-50741",
storageBucket: "common-staging-50741.appspot.com",
messagingSenderId: "78965953367",
appId: "1:78965953367:web:bc3e913a792fa28d2f6412",
apiKey: "AIzaSyBASCWJMV64mZJObeFEitLmdUC1HqmtjJk",
authDomain: "common-staging-1d426.firebaseapp.com",
databaseURL: "https://common-staging-1d426.firebaseio.com",
projectId: "common-staging-1d426",
storageBucket: "common-staging-1d426.appspot.com",
messagingSenderId: "701579202562",
appId: "1:701579202562:web:5729d8a875f98f6709571b",
},
cloudFunctionUrl:
"https://us-central1-common-staging-50741.cloudfunctions.net",
"https://europe-west1-common-staging-1d426.cloudfunctions.net",
deadSeaCommonId: "a55a1e9b-104a-4866-9f4f-3e017bbae281",
parentsForClimateCommonId: "a55a1e9b-104a-4866-9f4f-3e017bbae281",
saadiaCommonId: "a55a1e9b-104a-4866-9f4f-3e017bbae281",
Expand Down
3 changes: 3 additions & 0 deletions src/constants.scss
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,13 @@ $c-pink-active-btn: #f0daec;
$c-pink-active-feed-cards-light: #fcf4ff;
$c-pink-active-feed-cards: #a75a93;
$c-pink-hover-feed-cards: #fff9fd;
$c-gray-5: #f4f5f5;
$c-gray-20: #dcdee7;
$c-gray-30: #b7bcd2;
$c-gray-40: #8d91a9;
$c-gray-50: #7a819c;
$c-gray-60: #6b718e;
$c-gray-90: #1f2535;
$c-gray-100: #131b23;
$c-gray-800: #27292c;
$c-separator-light-non-opaque: rgba(60, 60, 67, 0.36);
Expand Down
4 changes: 2 additions & 2 deletions src/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,15 @@ body {

h2,
h1 {
font-family: NotoSerifSC-SemiBold, serif;
font-family: PoppinsSans, sans-serif;
}

p {
font-size: $moderate;
}

textarea {
font-family: NunitoSans, sans-serif;
font-family: PoppinsSans, sans-serif;
}
}

Expand Down
56 changes: 28 additions & 28 deletions src/pages/App/handlers/WebViewLoginHandler/WebViewLoginHandler.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,35 +10,35 @@ import { parseJson } from "@/shared/utils/json";
const WebViewLoginHandler: FC = () => {
const dispatch = useDispatch();

useEffect(() => {
window.addEventListener("message", (event) => {
const data = parseJson(event.data) as FirebaseCredentials;
if (!data?.providerId) {
return;
}
const handleWebviewLogin = React.useCallback((event) => {
const data = parseJson(event.data) as FirebaseCredentials;
if (!data?.providerId) {
return;
}

try {
dispatch(
webviewLogin.request({
payload: data,
callback: (isLoggedIn) => {
if (isLoggedIn) {
window.ReactNativeWebView.postMessage(
WebviewActions.loginSuccess,
);
history.push(getInboxPagePath_v04());
} else {
window.ReactNativeWebView.postMessage(WebviewActions.loginError);
}
},
}),
);
} catch (err) {
window.ReactNativeWebView.postMessage(WebviewActions.loginError);
}
}, []);

try {
dispatch(
webviewLogin.request({
payload: data,
callback: (isLoggedIn) => {
if (isLoggedIn) {
window.ReactNativeWebView.postMessage(
WebviewActions.loginSuccess,
);
history.push(getInboxPagePath_v04());
} else {
window.ReactNativeWebView.postMessage(
WebviewActions.loginError,
);
}
},
}),
);
} catch (err) {
window.ReactNativeWebView.postMessage(WebviewActions.loginError);
}
});
useEffect(() => {
window.addEventListener("message", handleWebviewLogin);
}, []);

return null;
Expand Down
4 changes: 2 additions & 2 deletions src/pages/App/router/configuration/commonSidenavLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { BillingPage_v04 } from "@/pages/billing";
import { ALL_COMMON_PAGE_TABS, CommonPage_v04 } from "@/pages/common";
import { CommonCreationPage_v04 } from "@/pages/commonCreation";
import { ProjectCreationPage_v04 } from "@/pages/commonCreation";
import { CommonEditingPage_v04 } from "@/pages/commonEditing";
import { CommonFeedPage_v04 } from "@/pages/commonFeed";
import { InboxPage_v04 } from "@/pages/inbox";
Expand Down Expand Up @@ -41,7 +41,7 @@ export const COMMON_SIDENAV_LAYOUT_CONFIGURATION: LayoutConfiguration<CommonSide
{
path: ROUTE_PATHS.V04_PROJECT_CREATION,
exact: true,
component: CommonCreationPage_v04,
component: ProjectCreationPage_v04,
},
{
path: ROUTE_PATHS.V04_COMMON_EDITING,
Expand Down
15 changes: 15 additions & 0 deletions src/pages/App/router/configuration/emptyLayout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { EmptyPage } from "@/pages/empty";
import { ROUTE_PATHS } from "@/shared/constants";
import { EmptyLayout } from "@/shared/layouts";
import { LayoutConfiguration } from "../types";

export const EMPTY_LAYOUT_CONFIGURATION: LayoutConfiguration = {
component: EmptyLayout,
routes: [
{
path: ROUTE_PATHS.MOBILE_LOADER,
exact: true,
component: EmptyPage,
},
],
};
10 changes: 7 additions & 3 deletions src/pages/App/router/configuration/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { mapRoutesToPaths } from "../helpers";
import { getPathNestingLevel, mapRoutesToPaths } from "../helpers";
import {
LayoutConfiguration,
LayoutConfigurationWithRouteProps,
Expand All @@ -7,6 +7,7 @@ import {
COMMON_SIDENAV_LAYOUT_CONFIGURATION,
CommonSidenavLayoutRouteOptions,
} from "./commonSidenavLayout";
import { EMPTY_LAYOUT_CONFIGURATION } from "./emptyLayout";
import {
MULTIPLE_SPACES_LAYOUT_CONFIGURATION,
MultipleSpacesLayoutRouteOptions,
Expand All @@ -25,6 +26,7 @@ type LayoutRouteOptions =
| unknown;

const CONFIGURATIONS: LayoutConfiguration<LayoutRouteOptions>[] = [
EMPTY_LAYOUT_CONFIGURATION,
OLD_LAYOUT_CONFIGURATION,
SIDENAV_LAYOUT_CONFIGURATION,
COMMON_SIDENAV_LAYOUT_CONFIGURATION,
Expand All @@ -34,8 +36,10 @@ const CONFIGURATIONS: LayoutConfiguration<LayoutRouteOptions>[] = [
export const ROUTES: LayoutConfigurationWithRouteProps<LayoutRouteOptions>[] =
CONFIGURATIONS.map((configuration) => {
// Sort paths like: /path/nested/nested2 -> /path/nested -> /path
const routes = [...configuration.routes].sort((prevRoute, nextRoute) =>
prevRoute < nextRoute ? 1 : -1,
const routes = [...configuration.routes].sort(
(prevRoute, nextRoute) =>
getPathNestingLevel(nextRoute.path) -
getPathNestingLevel(prevRoute.path),
);

return {
Expand Down
21 changes: 19 additions & 2 deletions src/pages/App/router/configuration/multipleSpacesLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { BillingPage } from "@/pages/billing";
import { ALL_COMMON_PAGE_TABS, CommonPage } from "@/pages/common";
import { CommonCreationPage } from "@/pages/commonCreation";
import {
CommonCreationPage,
ProjectCreationPage,
} from "@/pages/commonCreation";
import { CommonEditingPage } from "@/pages/commonEditing";
import { CommonFeedPage } from "@/pages/commonFeed";
import { InboxPage } from "@/pages/inbox";
Expand All @@ -10,7 +13,9 @@ import { MultipleSpacesLayout } from "@/shared/layouts";
import { LayoutConfiguration, RouteType } from "../types";

export interface MultipleSpacesLayoutRouteOptions {
withSidenav?: boolean;
withBreadcrumbs?: boolean;
withGoBack?: boolean;
breadcrumbsItemsWithMenus?: boolean;
}

Expand All @@ -20,6 +25,9 @@ const getCommonPageConfiguration =
path: `${ROUTE_PATHS.COMMON}/${tab}` as ROUTE_PATHS,
exact: true,
component: CommonPage,
routeOptions: {
withGoBack: true,
},
}));

export const MULTIPLE_SPACES_LAYOUT_CONFIGURATION: LayoutConfiguration<MultipleSpacesLayoutRouteOptions> =
Expand All @@ -36,6 +44,11 @@ export const MULTIPLE_SPACES_LAYOUT_CONFIGURATION: LayoutConfiguration<MultipleS
breadcrumbsItemsWithMenus: false,
},
},
{
path: ROUTE_PATHS.COMMON_CREATION,
exact: true,
component: CommonCreationPage,
},
{
path: ROUTE_PATHS.COMMON,
exact: true,
Expand All @@ -45,7 +58,7 @@ export const MULTIPLE_SPACES_LAYOUT_CONFIGURATION: LayoutConfiguration<MultipleS
{
path: ROUTE_PATHS.PROJECT_CREATION,
exact: true,
component: CommonCreationPage,
component: ProjectCreationPage,
},
{
path: ROUTE_PATHS.COMMON_EDITING,
Expand All @@ -57,15 +70,19 @@ export const MULTIPLE_SPACES_LAYOUT_CONFIGURATION: LayoutConfiguration<MultipleS
exact: true,
component: ProfilePage,
routeOptions: {
withSidenav: false,
withBreadcrumbs: false,
withGoBack: true,
},
},
{
path: ROUTE_PATHS.BILLING,
exact: true,
component: BillingPage,
routeOptions: {
withSidenav: false,
withBreadcrumbs: false,
withGoBack: true,
},
},
],
Expand Down
3 changes: 3 additions & 0 deletions src/pages/App/router/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@ export const mapRoutesToPaths = (routes: Route[]): ROUTE_PATHS[] => {

return Array.from(new Set(paths));
};

export const getPathNestingLevel = (path: string): number =>
path.split("/").length;
2 changes: 1 addition & 1 deletion src/pages/Auth/store/saga.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ const updateUserData = async (user: User) => {
const photoURL =
user.photo &&
(isRandomUserAvatarURL(user.photo)
? getRandomUserAvatarURL(profileData.displayName?.replaceAll(" ", "+"))
? getRandomUserAvatarURL(profileData.displayName?.replace(/\s/gi, "+"))
: user.photo);

if (photoURL) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@
.user-details-wrapper {
.user-details__title {
margin: 0;
font-family: NotoSerifSC, serif;
text-align: center;

@include big-phone {
Expand Down Expand Up @@ -179,7 +178,6 @@
.user-details-preview__name {
margin: 0 0 0.5rem;
height: 1.5rem;
font-family: NotoSerifSC, serif;
font-size: $moderate-small;
font-weight: bold;
}
Expand Down Expand Up @@ -207,7 +205,6 @@

.user-details-preview__intro-title {
margin: 0 0 0.5rem;
font-family: PoppinsSans, sans-serif;
font-size: $moderate;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

.edit-message-input__owner-name {
font-size: $xsmall;
font-weight: bold;
font-weight: 600;
color: $secondary-blue;
margin-bottom: 0.5rem;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@

.message-name {
font-size: $xsmall;
font-weight: bold;
font-weight: 600;
color: #001a36;
margin-bottom: 0.5rem;
}
Expand Down Expand Up @@ -309,7 +309,7 @@
.bottom-reply-message-user-name {
font-size: $xsmall;
line-height: 1.25rem;
font-weight: 700;
font-weight: 600;
margin-bottom: 0.125rem;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ const AssignCircleStage: FC<AssignCircleStageProps> = (props) => {
// TODO: Use here name of common member
title: `Request to join ${
assignCircleData.circle.name
} circle by ${getUserName(assignCircleData.commonMember.user)}`,
} by ${getUserName(assignCircleData.commonMember.user)}`,
description: assignCircleData.description,
images: [],
links: [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const Confirmation: FC<ConfirmationProps> = (props) => {
isCommonCreationLoading,
data: createdCommonData,
error: commonCreationError,
createCommon,
createCommon_DEPRECATED: createCommon,
} = useCommonCreation();
const {
isSubCommonCreationLoading,
Expand Down
Loading

0 comments on commit 9e32e99

Please sign in to comment.