Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev to Staging #2741

Merged
merged 33 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
e5a56d6
CW-Optimistic-streams Add optimistic UI
MeyerPV Aug 28, 2024
de5b98c
CW-optimistic-streams
MeyerPV Aug 30, 2024
ed3c9e9
Merge branch 'dev' into CW-Optimistic-streams
MeyerPV Aug 30, 2024
5a1d7ad
CW-optimistic-streams Added generation of proposalid
MeyerPV Aug 30, 2024
45a9a65
Merge branch 'CW-Optimistic-streams' of https://github.com/daostack/c…
MeyerPV Aug 30, 2024
a6eaa74
CW-Optimistic-stream Remove unnecessary comments
MeyerPV Sep 1, 2024
a4476a6
CW-Optimistic-streams
MeyerPV Sep 2, 2024
bd8fd51
CW-Optimistic-streams
MeyerPV Sep 2, 2024
b068156
CW-optimistic-streams
MeyerPV Sep 5, 2024
a80e269
CW-optimistic-streams
MeyerPV Sep 17, 2024
6c332c7
CW-optimistic-streams
MeyerPV Sep 30, 2024
d0483cf
Merge pull request #2729 from daostack/CW-Optimistic-streams
MeyerPV Oct 1, 2024
10531d1
CW-sync-all-roles
MeyerPV Oct 1, 2024
e540465
Merge branch 'dev' into CW-sync-all-roles
MeyerPV Oct 1, 2024
fd4dbf7
CW-mention-arrow-bug
MeyerPV Oct 1, 2024
81087f6
CW-clear-after-send
MeyerPV Oct 1, 2024
0608a19
CW-performance
MeyerPV Oct 3, 2024
a21a84e
CW-performance
MeyerPV Oct 7, 2024
9b6a00c
CW-instant-chat-message-edit
MeyerPV Oct 7, 2024
193847d
CW-instant-chat-message-edit
MeyerPV Oct 7, 2024
350b39d
CW-copy-link-in-2-steps
MeyerPV Oct 8, 2024
c48ade7
Merge pull request #2739 from daostack/CW-mention-arrow-bug
matanfield Oct 8, 2024
ef235f2
Merge pull request #2740 from daostack/CW-performance
matanfield Oct 8, 2024
105c698
Merge pull request #2738 from daostack/CW-sync-all-roles
matanfield Oct 8, 2024
44eef1d
CW-instant-chat-message-edit
MeyerPV Oct 10, 2024
28b27cf
CW-copy-link-in-2-steps
MeyerPV Oct 10, 2024
4a18934
CW-fix-mark-as-read-unread
MeyerPV Oct 10, 2024
2e2b163
CW-copy-link-in-2-steps
MeyerPV Oct 11, 2024
94de9b9
CW-instant-chat-message-edit
MeyerPV Oct 11, 2024
ade8ab8
Merge pull request #2743 from daostack/CW-copy-link-in-2-steps
MeyerPV Oct 11, 2024
983a905
Merge pull request #2742 from daostack/CW-instant-chat-message-edit
MeyerPV Oct 11, 2024
69b9193
CW-fix-mark-as-read-unread
MeyerPV Oct 14, 2024
05f3419
Merge pull request #2744 from daostack/CW-fix-mark-as-read-unread
matanfield Oct 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,10 @@
}

.loader-wrapper {
position: relative;
position: absolute;
left: 50%;
transform: translateX(-50%);
top: 50%;
transform: translate(-50%, -50%);
height: 75px;
width: 75px;
background-image: url(/icons/loader-pink.svg);
Expand Down
3 changes: 3 additions & 0 deletions src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import "./projectSetupImports";
import React from "react";
import ReactDOM from "react-dom";
import { enableMapSet } from "immer";
import { App, AppWrapper } from "@/pages/App";

enableMapSet();

ReactDOM.render(
<AppWrapper>
<App />
Expand Down
2 changes: 1 addition & 1 deletion src/pages/App/router/Router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { ROUTES } from "./configuration";
const Router: FC = () => (
<Switch>
{ROUTES.map((layoutConfiguration, index) => (
<Layout key={index} {...layoutConfiguration} />
<Layout key={index} {...layoutConfiguration} />
))}
<Redirect />
</Switch>
Expand Down
9 changes: 5 additions & 4 deletions src/pages/App/router/components/Layout/Layout.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
import React, { FC } from "react";
import React, { FC, Suspense } from "react";
import { Route, Switch } from "react-router-dom";
import { LayoutConfigurationWithRouteProps } from "../../types";
import { LayoutRoute } from "../LayoutRoute";
import { SuspenseLoader } from "@/shared/ui-kit";

const Layout: FC<LayoutConfigurationWithRouteProps> = (props) => {
const { component: LayoutComponent, routes, ...restProps } = props;

return (
<LayoutRoute routeConfigurations={routes} {...restProps}>
<LayoutComponent>
<Suspense fallback={SuspenseLoader}>
<Switch>
{routes.map((route) => (
<Route key={route.path} {...route} />
))}
{routes.map((route) => <Route key={route.path} {...route} />)}
</Switch>
</Suspense>
</LayoutComponent>
</LayoutRoute>
);
Expand Down
31 changes: 17 additions & 14 deletions src/pages/App/router/components/LayoutRoute/LayoutRoute.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FC, useMemo } from "react";
import React, { FC, Suspense, useMemo } from "react";
import { useSelector } from "react-redux";
import { Route, RouteProps } from "react-router-dom";
import { Route as RouteConfiguration } from "@/pages/App/router/types";
Expand All @@ -9,6 +9,7 @@ import {
import { matchRoute } from "@/shared/utils";
import { LayoutRouteContext, LayoutRouteContextValue } from "./context";
import { renderRouteContent } from "./helpers";
import { SuspenseLoader } from "@/shared/ui-kit";

interface PrivateRouteProps extends RouteProps {
routeConfigurations: RouteConfiguration[];
Expand Down Expand Up @@ -36,19 +37,21 @@ const LayoutRoute: FC<PrivateRouteProps> = (props) => {

return (
<LayoutRouteContext.Provider value={contextValue}>
<Route
{...restProps}
render={(routeProps) =>
renderRouteContent({
...routeProps,
component,
children,
configuration: routeConfiguration,
userRoles: userRoles || [],
authenticated,
})
}
/>
<Suspense fallback={SuspenseLoader}>
<Route
{...restProps}
render={(routeProps) =>
renderRouteContent({
...routeProps,
component,
children,
configuration: routeConfiguration,
userRoles: userRoles || [],
authenticated,
})
}
/>
</Suspense>
</LayoutRouteContext.Provider>
);
};
Expand Down
133 changes: 66 additions & 67 deletions src/pages/App/router/configuration/commonSidenavLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,76 +1,75 @@
import { BillingPage_v04 } from "@/pages/billing";
import { ALL_COMMON_PAGE_TABS, CommonPage_v04 } from "@/pages/common";
import {
CommonCreationPage,
ProjectCreationPage_v04,
} from "@/pages/commonCreation";
import { CommonEditingPage_v04 } from "@/pages/commonEditing";
import { CommonFeedPage_v04 } from "@/pages/commonFeed";
import { InboxPage_v04 } from "@/pages/inbox";
import { ProfilePage_v04 } from "@/pages/profile";
import { SettingsPage_v04 } from "@/pages/settings";
import React, { lazy } from "react";
import { ROUTE_PATHS } from "@/shared/constants";
import { CommonSidenavLayout } from "@/shared/layouts";
import { LayoutConfiguration, RouteType } from "../types";
import { ALL_COMMON_PAGE_TABS } from "@/pages/common";

const InboxPage_v04 = lazy(() => import("@/pages/inbox").then(module => ({ default: module.InboxPage_v04 })));
const CommonCreationPage = lazy(() => import("@/pages/commonCreation").then(module => ({ default: module.CommonCreationPage })));
const CommonFeedPage_v04 = lazy(() => import("@/pages/commonFeed").then(module => ({ default: module.CommonFeedPage_v04 })));
const ProjectCreationPage_v04 = lazy(() => import("@/pages/commonCreation").then(module => ({ default: module.ProjectCreationPage_v04 })));
const CommonEditingPage_v04 = lazy(() => import("@/pages/commonEditing").then(module => ({ default: module.CommonEditingPage_v04 })));
const ProfilePage_v04 = lazy(() => import("@/pages/profile").then(module => ({ default: module.ProfilePage_v04 })));
const BillingPage_v04 = lazy(() => import("@/pages/billing").then(module => ({ default: module.BillingPage_v04 })));
const SettingsPage_v04 = lazy(() => import("@/pages/settings").then(module => ({ default: module.SettingsPage_v04 })));
const CommonPage_v04 = lazy(() => import("@/pages/common").then(module => ({ default: module.CommonPage_v04 })));

export interface CommonSidenavLayoutRouteOptions {
sidenav?: boolean;
}

const getCommonPageConfiguration =
(): LayoutConfiguration<CommonSidenavLayoutRouteOptions>["routes"] =>
ALL_COMMON_PAGE_TABS.map((tab) => ({
path: `${ROUTE_PATHS.V04_COMMON}/${tab}` as ROUTE_PATHS,
exact: true,
component: CommonPage_v04,
}));
const getCommonPageConfiguration = (): LayoutConfiguration["routes"] =>
ALL_COMMON_PAGE_TABS.map((tab) => ({
path: `${ROUTE_PATHS.V04_COMMON}/${tab}` as ROUTE_PATHS,
exact: true,
component: CommonPage_v04,
}));

export const COMMON_SIDENAV_LAYOUT_CONFIGURATION: LayoutConfiguration<CommonSidenavLayoutRouteOptions> =
{
component: CommonSidenavLayout,
routes: [
{
path: ROUTE_PATHS.V04_INBOX,
exact: true,
component: InboxPage_v04,
type: RouteType.Private,
unauthenticatedRedirectPath: ROUTE_PATHS.HOME,
},
{
path: ROUTE_PATHS.V04_COMMON_CREATION,
exact: true,
component: CommonCreationPage,
},
{
path: ROUTE_PATHS.V04_COMMON,
exact: true,
component: CommonFeedPage_v04,
},
...getCommonPageConfiguration(),
{
path: ROUTE_PATHS.V04_PROJECT_CREATION,
exact: true,
component: ProjectCreationPage_v04,
},
{
path: ROUTE_PATHS.V04_COMMON_EDITING,
exact: true,
component: CommonEditingPage_v04,
},
{
path: ROUTE_PATHS.V04_PROFILE,
exact: true,
component: ProfilePage_v04,
},
{
path: ROUTE_PATHS.V04_BILLING,
exact: true,
component: BillingPage_v04,
},
{
path: ROUTE_PATHS.V04_SETTINGS,
exact: true,
component: SettingsPage_v04,
},
],
};
export const COMMON_SIDENAV_LAYOUT_CONFIGURATION: LayoutConfiguration = {
component: CommonSidenavLayout,
routes: [
{
path: ROUTE_PATHS.V04_INBOX,
exact: true,
component: InboxPage_v04,
type: RouteType.Private,
unauthenticatedRedirectPath: ROUTE_PATHS.HOME,
},
{
path: ROUTE_PATHS.V04_COMMON_CREATION,
exact: true,
component: CommonCreationPage,
},
{
path: ROUTE_PATHS.V04_COMMON,
exact: true,
component: CommonFeedPage_v04,
},
...getCommonPageConfiguration(),
{
path: ROUTE_PATHS.V04_PROJECT_CREATION,
exact: true,
component: ProjectCreationPage_v04,
},
{
path: ROUTE_PATHS.V04_COMMON_EDITING,
exact: true,
component: CommonEditingPage_v04,
},
{
path: ROUTE_PATHS.V04_PROFILE,
exact: true,
component: ProfilePage_v04,
},
{
path: ROUTE_PATHS.V04_BILLING,
exact: true,
component: BillingPage_v04,
},
{
path: ROUTE_PATHS.V04_SETTINGS,
exact: true,
component: SettingsPage_v04,
},
],
};
7 changes: 5 additions & 2 deletions src/pages/App/router/configuration/emptyLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import { PrivacyPolicy } from "@/pages/PrivacyPolicy";
import { EmptyPage } from "@/pages/empty";
import React, { lazy } from "react";
import { ROUTE_PATHS } from "@/shared/constants";
import { EmptyLayout } from "@/shared/layouts";
import { LayoutConfiguration } from "../types";

// Wrapping non-default exports for lazy loading
const EmptyPage = lazy(() => import("@/pages/empty").then(module => ({ default: module.EmptyPage })));
const PrivacyPolicy = lazy(() => import("@/pages/PrivacyPolicy").then(module => ({ default: module.PrivacyPolicy })));

export const EMPTY_LAYOUT_CONFIGURATION: LayoutConfiguration = {
component: EmptyLayout,
routes: [
Expand Down
Loading
Loading