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

Project Creation Feature Implementation #31

Open
wants to merge 28 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
e56c36c
Add pagination
denkravchu Dec 25, 2024
abacd77
Change display projects
denkravchu Dec 26, 2024
05d44cf
Add WrapperUserInputModal
denkravchu Dec 26, 2024
24dec22
Change FileInput
denkravchu Dec 26, 2024
025eeeb
Changed form of content editing
denkravchu Dec 27, 2024
5b2dda9
Add contracts create
denkravchu Dec 31, 2024
45f6c01
Fix data contract create
pshenmic Jan 2, 2025
de2ebc7
Add creating document
denkravchu Jan 5, 2025
789f54a
Add data contract identifier in the Dash SDK config
pshenmic Jan 6, 2025
18fbf07
Add sample code for submitting documents
pshenmic Jan 6, 2025
224f409
Add creation documents and document receipt
denkravchu Jan 7, 2025
9c01827
Add a zero client
denkravchu Jan 7, 2025
75311c9
Add Grade
denkravchu Jan 7, 2025
158e51f
Add project loading
denkravchu Jan 8, 2025
484ed37
Add ProjectListItemSkeleton
denkravchu Jan 8, 2025
fc519d2
Add Task
denkravchu Jan 8, 2025
0c16b3d
Try fix registration
denkravchu Jan 10, 2025
9706ea6
Update yarn lock
pshenmic Jan 10, 2025
3a61d5d
Add isValidImageUrl
denkravchu Jan 10, 2025
e4654f8
change add pictures
denkravchu Jan 10, 2025
5689701
Add get document creator
denkravchu Jan 10, 2025
9a166dd
Add formatOwnerId
denkravchu Jan 10, 2025
e8a7e61
Add dynamic import
denkravchu Jan 11, 2025
42e1793
Add editing document
denkravchu Jan 11, 2025
bf60e2d
Tried delete documents
denkravchu Jan 12, 2025
d823525
Resolve merge conflicts
denkravchu Jan 12, 2025
1e08926
Tried hide deleted documents
denkravchu Jan 14, 2025
e67263b
Remove faulty dapi url
pshenmic Jan 14, 2025
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
11 changes: 10 additions & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,2 +1,11 @@
NEXT_PUBLIC_PASSWORD_ADMIN=adminadmin
NEXT_PUBLIC_ADMIN_IDENTIFIER=2MfmHqYmAk1jAQNv7SsGJPT22MrfKFcHKZDc7cTu2biX
# NEXT_PUBLIC_ADMIN_IDENTIFIER=Y6WwZ3LYETZjsekjWjoZWnSBu9o5P5MD4Z3HmVGJiYt
NEXT_PUBLIC_ADMIN_IDENTIFIER=Y6WwZ3LYETZjsekjWjoZWnSBu9o5P5MD4Z3HmVGJiYt
NEXT_PUBLIC_INITIAL_CLIENT=2MfmHqYmAk1jAQNv7SsGJPT22MrfKFcHKZDc7cTu2biX

# contract Id

# PROJECTS
NEXT_PUBLIC_CONTRACT_ID_PROJECTS=pshenmic-dev-dfo
NEXT_PUBLIC_CONTRACT_ID=GxWe9P43UAfWiMHpZzCXJaSwZkcqzvZR6wtgofyBG5cu
#
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"react-dom": "^18",
"react-dropzone": "^14.2.3",
"react-hook-form": "^7.52.2",
"react-intersection-observer": "^9.14.1",
"react-router": "^6.21.1",
"react-router-dom": "^6.21.1",
"react-toastify": "^10.0.6",
Expand Down
Binary file added public/assets/img/pictureOfaBlindfold.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion src/app/App.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ body {
overflow: hidden;
height: 100%;
width: 100%;
padding: 40px 20px;
padding-left: 20px;

&::before, &:after {
background-color: #0075FF;
Expand Down Expand Up @@ -59,6 +59,7 @@ body {
display: flex;
flex-direction: column;
justify-content: space-between;
padding: 40px 0px;
}

@media screen and ( max-width: 1700px) {
Expand Down
14 changes: 10 additions & 4 deletions src/app/layout.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import HasAdminAccess from '@/components/HasAdminAccess/HasAdminAccess'
import EditingWindow from '@/components/UI/EditingWindow/EditingWindow'
import RegistrationWindow from '@/components/Registration/RegistrationWindow'
import ImportWalletWindow from '@/components/Registration/ImportWalletWindow'
import dynamic from "next/dynamic"
import { DashProvider } from '@/hooks/useDashClient'
import './globals.css'
Expand All @@ -12,6 +9,16 @@ const ToastContainer = dynamic(() =>
{ ssr: false }
)

const EditingWindow = dynamic(() =>
import('@/components/UI/EditingWindow/EditingWindow'),
{ ssr: false }
)

const ImportWalletWindow = dynamic(() =>
import('@/components/Registration/ImportWalletWindow'),
{ ssr: false }
)

export const metadata = {
title: 'pshenmic.Dev',
description: 'Developer space of pshenmic'
Expand All @@ -23,7 +30,6 @@ export default function RootLayout({ children }) {
<body>
<DashProvider>
<ToastContainer />
<HasAdminAccess />
<EditingWindow />
<RegistrationWindow />
<ImportWalletWindow />
Expand Down
85 changes: 51 additions & 34 deletions src/app/page.js
Original file line number Diff line number Diff line change
@@ -1,60 +1,77 @@
'use client'

import './App.scss'
import { useState, useEffect } from 'react'
import Menu from '../components/Menu'
import CommandLine from '../components/CommandLine/CommandLine'
import { motion as m } from 'framer-motion'
import { BrowserRouter as Router } from 'react-router-dom'
import ContentBlock from '@/components/ContentBlock/ContentBlock'
import { usePathname } from 'next/navigation'
import useGlobalStore from '@/store/store'
import Dash from "dash";
import { showToast } from '@/lib/showToast'
import { usePathname } from 'next/navigation'
import { BrowserRouter as Router } from 'react-router-dom'
import { motion as m } from 'framer-motion'
import { useState, useEffect } from 'react'

const defaultContent = 'updates'

export default function App () {
export default function App() {
const { setClient } = useGlobalStore();
const [content, setContent] = useState(defaultContent)
const [render, setRender] = useState(false)
const path = usePathname()
const setOpenAdminAccessPopup = useGlobalStore(state => state.setOpenAdminAccessPopup)
const openAdminAccessPopup = useGlobalStore(state => state.openAdminAccessPopup)
const setAdmin = useGlobalStore(state => state.setAdmin)

useEffect(() => {
const hasAdminAccess = localStorage.getItem('isAdminPshenmic')
const isAdminPath = path.includes('admin')
setOpenAdminAccessPopup(isAdminPath && !hasAdminAccess)
setAdmin(isAdminPath && !!hasAdminAccess)
}, [path, openAdminAccessPopup])

// adding a zero client
useEffect(() => {
// removal of administrator access
const dataClear = localStorage.getItem('dataClear')
const now = new Date()
// localStorage.clear()
if (dataClear && now.getTime() >= dataClear) {
localStorage.clear()
const addClient = async () => {
try {
const clientOpts = {
network: 'testnet',
apps: {
tutorialContract: {
contractId: process.env.NEXT_PUBLIC_INITIAL_CLIENT,
},
"pshenmic-dev-dfo": {
contractId: process.env.NEXT_PUBLIC_CONTRACT_ID,
},
},
wallet: {
skipSynchronizationBeforeHeight: 1,
offlineMode: true,
},
};
const client = new Dash.Client(clientOpts);

if (client) {
setClient(client)
}
} catch (error) {
console.error('Error:', error);
showToast('error', 'Error logging in, try again later');
}
}
addClient()
}, [])

useEffect(() => {
const pathArray = window.location.pathname.split('/').slice(1)
setRender(true)
setContent(pathArray[0] !== '' ? pathArray[0] : defaultContent)
}, [])

return render
? <Router>
<main className={'App'}>
<m.div className={'App__CommonWrapper'}>
<div className={'App__Sidebar'}>
<Menu selectItemCallback={setContent} defaultItem={content}/>
{ path.includes('admin')
? null
: <CommandLine category={content}/>
}
</div>
<ContentBlock />
</m.div>
</main>
</Router>
<main className={'App'}>
<m.div className={'App__CommonWrapper'}>
<div className={'App__Sidebar'}>
<Menu selectItemCallback={setContent} defaultItem={content} />
{path.includes('admin')
? null
: <CommandLine category={content} />
}
</div>
<ContentBlock />
</m.div>
</main>
</Router>
: null
}
Loading