Skip to content

Commit

Permalink
🎨🤭 ↣ Failure to implement system-wide context from Vite package migra…
Browse files Browse the repository at this point in the history
…tion

Signal-K/Silfur#25
  • Loading branch information
Gizmotronn committed Dec 22, 2022
1 parent e5656dd commit ed98d2e
Show file tree
Hide file tree
Showing 33 changed files with 575 additions and 35 deletions.
Binary file modified .DS_Store
Binary file not shown.
3 changes: 2 additions & 1 deletion client/client/pages/_app.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import '../styles/globals.css';
import React from 'react';

// Imports for proposals/voting section
import { ProposalDetails, CreateProposal, Home, Profile } from './proposals';
import { ProposalDetails, CreateProposal, Home, Profile } from './proposals/Home';

function MyApp({ Component, pageProps }) {
return <Component {...pageProps} />
Expand Down
6 changes: 3 additions & 3 deletions client/client/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Head from 'next/head';
import Image from 'next/image';
import styles from '../styles/Home.module.css';
import Head from 'next/head'
import Image from 'next/image'
import styles from '../styles/Home.module.css'

export default function Home() {
return (
Expand Down
32 changes: 32 additions & 0 deletions client/client/pages/proposals/Home.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*export { default as Home } from './Home';
export { default as Profile } from './Profile';
export { default as CreateProposal } from './CreateProposal';
export { default as ProposalDetails } from './ProposalDetails';*/

import React, { useState, useEffect } from "react";
import { useStateContext } from './context';
//import { DisplayProposals } from './components';

const Home = () => {
const [isLoading, setIsLoading] = useState(false);
const [proposals, setProposals] = useState([]); // Empty array, retrieved from the state context from onchain

const { address, contract, getProposals } = useStateContext(); /*
const fetchProposals = async () => { // This is to allow us to call this g.request in the useEffect (as the request is async in /context)
setIsLoading(true);
const data = await getProposals();
setProposals(data);
setIsLoading(false);
}
useEffect(() => {
if (contract) fetchProposals();
console.log(proposals);
}, [address, contract]); // Re-called when these change*/

return (
<div>Hello World</div>
)
}

export default Home;
10 changes: 10 additions & 0 deletions client/client/pages/proposals/assets/create-campaign.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions client/client/pages/proposals/assets/dashboard.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions client/client/pages/proposals/assets/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import createCampaign from './create-campaign.svg';
import dashboard from './dashboard.svg';
import logo from './logo.svg';
import logout from './logout.svg';
import payment from './payment.svg';
import profile from './profile.svg';
import sun from './sun.svg';
import withdraw from './withdraw.svg';
import tagType from './type.svg';
import search from './search.svg';
import menu from './menu.svg';
import money from './money.svg';
import loader from './loader.svg';
import thirdweb from './thirdweb.png';

export {
tagType,
createCampaign,
dashboard,
logo,
logout,
payment,
profile,
sun,
withdraw,
search,
menu,
money,
loader,
thirdweb,
};
51 changes: 51 additions & 0 deletions client/client/pages/proposals/assets/loader.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions client/client/pages/proposals/assets/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions client/client/pages/proposals/assets/logout.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions client/client/pages/proposals/assets/menu.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions client/client/pages/proposals/assets/money.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions client/client/pages/proposals/assets/payment.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions client/client/pages/proposals/assets/profile.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions client/client/pages/proposals/assets/search.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions client/client/pages/proposals/assets/sun.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/client/pages/proposals/assets/thirdweb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit ed98d2e

Please sign in to comment.