Skip to content

Commit

Permalink
client roots -> dynamic. tsconfig dist (#20)
Browse files Browse the repository at this point in the history
1) tsconfig moduleResolution downgraded
2) all browser specific components ---> dynamic ssr: false

---------

Co-authored-by: TriplEight
  • Loading branch information
hydra134 authored Sep 12, 2023
1 parent 60bc865 commit c5d1049
Show file tree
Hide file tree
Showing 11 changed files with 47 additions and 30 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ jobs:
steps:
- uses: actions/checkout@v4
- run: yarn
- run: yarn build
2 changes: 1 addition & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
## (optional) Settings for Netlify Dev
## https://github.com/netlify/cli/blob/main/docs/netlify-dev.md#project-detection
[dev]
command = "next start" # Command to start your dev server
command = "yarn start" # Command to start your dev server
port = 3000 # Port that the dev server will be listening on
# publish = "dist" # Folder with the static content for _redirect file
publish = ".next"
Expand Down
34 changes: 17 additions & 17 deletions src/Components/submitProposal/theproposal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { useContext, useState } from "react";
import { useRouter } from "next/navigation";
import { useProposalContext } from "@/Context/submitPropolsal";
import ProposalName from "../ProposalName";
import TextEditorDropdown from "@/Components/TextEditor/TextEditorDropdown";
// import TextEditorDropdown from "@/Components/TextEditor/TextEditorDropdown";

type Props = {
className?: string;
Expand Down Expand Up @@ -72,11 +72,11 @@ const SubmitProposalContext: React.FC<Props> = (props) => {
</p>
</div>

<TextEditorDropdown
{/* <TextEditorDropdown
text={context?.contextOfTheProposal}
changeText={handleContextOfProposal}
className="text-black mt-5"
/>
/> */}

{/* <div className="mt-5">
<p className="hover:cursor-pointer text-gray-400">
Expand Down Expand Up @@ -105,11 +105,11 @@ const SubmitProposalContext: React.FC<Props> = (props) => {
</p>
</div>

<TextEditorDropdown
{/* <TextEditorDropdown
text={context?.knownBackups}
changeText={handleKnownBackups}
className="text-black mt-5"
/>
/> */}

<div className="border border-black py-5 px-4 mt-10">
<h2 className="text-xl">2. Problem Statement</h2>
Expand All @@ -120,11 +120,11 @@ const SubmitProposalContext: React.FC<Props> = (props) => {
</p>
</div>

<TextEditorDropdown
{/* <TextEditorDropdown
text={context?.problemStatement}
changeText={handleProblemStatement}
className="text-black mt-5"
/>
/> */}

<div className="mt-10 border border-black py-5 px-4">
<h2 className="text-xl">3. The Solution</h2>
Expand All @@ -137,11 +137,11 @@ const SubmitProposalContext: React.FC<Props> = (props) => {
</p>
</div>

<TextEditorDropdown
{/* <TextEditorDropdown
text={context?.solution}
changeText={handleSolution}
className="text-black mt-5"
/>
/> */}

<div className="mt-10 border border-black py-5 px-4">
<h2 className="text-xl">
Expand All @@ -158,11 +158,11 @@ const SubmitProposalContext: React.FC<Props> = (props) => {
</p>
</div>

<TextEditorDropdown
{/* <TextEditorDropdown
text={context?.ksmImprovements}
changeText={handleKsmImprovements}
className="text-black mt-5"
/>
/> */}

<div className="mt-10 border border-black py-5 px-4">
<h2 className="text-xl">b. Who does this solution help?</h2>
Expand All @@ -172,11 +172,11 @@ const SubmitProposalContext: React.FC<Props> = (props) => {
</p>
</div>

<TextEditorDropdown
{/* <TextEditorDropdown
text={context?.targetAudience}
changeText={handleTargetAudience}
className="text-black mt-5"
/>
/> */}

<div className="mt-10 border border-black py-5 px-4">
<h2 className="text-xl">4. Why Kusama</h2>
Expand All @@ -186,11 +186,11 @@ const SubmitProposalContext: React.FC<Props> = (props) => {
</p>
</div>

<TextEditorDropdown
{/* <TextEditorDropdown
text={context?.whyKSM}
changeText={handleWhyKSM}
className="text-black mt-5"
/>
/> */}

<div className="mt-10 border border-black py-5 px-4">
<h2 className="text-xl">
Expand All @@ -199,11 +199,11 @@ const SubmitProposalContext: React.FC<Props> = (props) => {
</h2>
</div>

<TextEditorDropdown
{/* <TextEditorDropdown
text={context?.similarSolution}
changeText={handleSimilarSolution}
className="text-black mt-5"
/>
/> */}

{/* Button Row - take one level up */}

Expand Down
3 changes: 2 additions & 1 deletion src/Context/submitPropolsal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export type submitContext = {
changeMilestones: (milestone: any) => void;
};

const defaultState = {
const defaultState: submitContext = {
proposalStep: undefined,
proposalIndex: null,
setProposalIndex: (index: number) => {
Expand Down Expand Up @@ -144,6 +144,7 @@ const defaultState = {
changeMilestones: (milestone: any) => {
return;
},
changeProposalContext: () => {}
};

type Props = {
Expand Down
8 changes: 4 additions & 4 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
"use client";

import { useEffect } from "react";

import LogIn from "@/Components/Login/";
// import LogIn from "@/Components/Login/";
import dynamic from "next/dynamic";

const LogIn = dynamic(() => import('@/Components/Login'), {ssr: false})

export default function Home() {
return (
<main className="">
<LogIn />
<LogIn />
</main>
);
}
5 changes: 4 additions & 1 deletion src/app/signup/chooseprofile/2/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@ import { useProfileContext } from "@/Context/ProfileStore";
import { useChainApiContext } from "@/Context/ChainApiStore";
import { usePhalaContractContext } from "@/Context/PhalaContractApiStore";
import { useEffect, useState } from "react";
import ConnectWallet from "@/Components/ConnectWallet";
// import ConnectWallet from "@/Components/ConnectWallet";
import { onSignCertificate } from "@/lib/PhalaContract/Utils/phalaCertificate";
import { useWalletContext } from "@/Context/WalletStore";
import dynamic from "next/dynamic";

const ConnectWallet = dynamic(() => import('@/Components/ConnectWallet'), {ssr: false})

const ChooseProfileStep2 = () => {
//Context
Expand Down
5 changes: 4 additions & 1 deletion src/app/signup/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
import Link from "next/link";
import Image from "next/image";
import OrdumLogoLight from "@/assets/svg-icons/ordum-logo-light.svg";
import ConnectWallet from "@/Components/ConnectWallet";
import dynamic from "next/dynamic";
// import ConnectWallet from "@/Components/ConnectWallet";

const ConnectWallet = dynamic(() => import('@/Components/ConnectWallet'), {ssr: false})

const SignUp = () => {
// const { user } = useSelector((state: RootState) => state.user);
Expand Down
5 changes: 4 additions & 1 deletion src/app/submitproposal/review/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
import Layout from "@/Components/ui/Layout";
import SubmitPropolsalPreview from "@/Components/submitProposal/review";
import SubmitPropolsalSidePanel from "@/Components/submitProposal/sidePanel";
import Review from "@/Components/Review";
// import Review from "@/Components/Review";
import dynamic from "next/dynamic";

const Review = dynamic(() => import('@/Components/Review'), {ssr:false})

const submitProposalPreview = () => {

Expand Down
5 changes: 4 additions & 1 deletion src/app/submitproposal/theproposal/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@

import Layout from "@/Components/ui/Layout";
import SubmitPropolsalSidePanel from "@/Components/submitProposal/sidePanel";
import Editor from "@/Components/OrdumTextEditor/src/ProposalEditor";
// import Editor from "@/Components/OrdumTextEditor/src/ProposalEditor";
import SubmitProposalContext from "@/Components/submitProposal/theproposal";
import SubmitProposalTextEditor from "@/Components/submitProposal/SubmitProposalTextEditor/page";
import dynamic from "next/dynamic";

const Editor = dynamic(() => import('@/Components/OrdumTextEditor/src/ProposalEditor'), {ssr: false})

const SubmitProposal: React.FC = () => {
return (
Expand Down
7 changes: 5 additions & 2 deletions src/app/texteditor/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@
// import Editor from "@/Components/LexicalTextEditor/Editor";
// import Editor from "@/Components/OrdumTextEditor/Editor";
// import Editor from "@/Components/TestEditor/packages/lexical-playground/src/Editor";
import Editor from "@/Components/OrdumTextEditor/src/app"
import Viewer from "@/Components/OrdumTextEditor/src/Viewer"
// import Editor from "@/Components/OrdumTextEditor/src/app"
// import Viewer from "@/Components/OrdumTextEditor/src/Viewer"
import dynamic from "next/dynamic";
import { useState } from "react";

const Viewer = dynamic(() => import('@/Components/OrdumTextEditor/src/Viewer'), {ssr: false})

const TextEditor: React.FC = () => {
const [text, setText] = useState("");
const [description, setDescription] = useState(text);
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"incremental": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "NodeNext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
Expand Down

0 comments on commit c5d1049

Please sign in to comment.