Skip to content

Commit

Permalink
fixup! fixup! feat: builds
Browse files Browse the repository at this point in the history
  • Loading branch information
RasenGUY committed Dec 1, 2023
1 parent 1cdd18b commit 44f5bdb
Show file tree
Hide file tree
Showing 10 changed files with 86 additions and 28 deletions.
6 changes: 3 additions & 3 deletions .env.development
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
MODE=development
VITE_REDUX_DEBUG=true
NPM_TOKEN=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
GSAP_TOKEN=5b8296c2-d882-401b-be86-87707a83f99d
NPM_TOKEN=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
VITE_BACKEND_API_URL=https://app.wega.fun/api
VITE_RPC_PROVIDER_ALCHEMY=y9Gx-Wglr_8PQ67heuNUZ18rwoUEip9B
VITE_WALLET_CONNECT_ID=210ab6fbbd6f9d07fd69a357b4c39a13
VITE_BACKEND_API_URL=http://127.0.0.1:3000

# FIREBASE CONFIG
VITE_FIREBASE_API_KEY=AIzaSyD6NTn82GLXFGWGWKNsmmwhohOHJXaHaoQ
VITE_FIREBASE_AUTH_DOMAIN=inspired-bebop-399607.firebaseapp.com
VITE_FIREBASE_DB_URL=https://inspired-bebop-399607-default-rtdb.firebaseio.com
VITE_FIREBASE_AUTH_DOMAIN=inspired-bebop-399607.firebaseapp.com
VITE_FIREBASE_PROJECT_ID=inspired-bebop-399607
VITE_FIREBASE_STORAGE_BUCKET=inspired-bebop-399607.appspot.com
VITE_FIREBASE_MESSAGING_SENDER_ID=368714610861
Expand Down
7 changes: 3 additions & 4 deletions .env.qa
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
mode=qa
VITE_BACKEND_API_URL=https://35.208.209.92:3000/
VITE_REDUX_DEBUG=true
VITE_BACKEND_API_URL=https://app.wega.fun/api
NPM_TOKEN=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
GSAP_TOKEN=5b8296c2-d882-401b-be86-87707a83f99d
VITE_RPC_PROVIDER_ALCHEMY=y9Gx-Wglr_8PQ67heuNUZ18rwoUEip9B
VITE_WALLET_CONNECT_ID=210ab6fbbd6f9d07fd69a357b4c39a13

# fire base configs
# FIREBASE CONFIG
VITE_FIREBASE_API_KEY=AIzaSyD6NTn82GLXFGWGWKNsmmwhohOHJXaHaoQ
VITE_FIREBASE_AUTH_DOMAIN=inspired-bebop-399607.firebaseapp.com
VITE_FIREBASE_DB_URL=https://inspired-bebop-399607-default-rtdb.firebaseio.com
VITE_FIREBASE_PROJECT_ID=inspired-bebop-399607
VITE_FIREBASE_STORAGE_BUCKET=inspired-bebop-399607.appspot.com
VITE_FIREBASE_MESSAGING_SENDER_ID=368714610861
VITE_FIREBASE_APP_ID=1:368714610861:web:25a05efd0381cbd552ee24

VITE_FIREBASE_APP_ID=1:368714610861:web:25a05efd0381cbd552ee2
31 changes: 31 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"firebase": "^10.3.1",
"gsap": "npm:@gsap/shockingly@^3.12.2",
"joi": "^17.9.2",
"path": "^0.12.7",
"react": "^18.2.0",
"react-awesome-reveal": "^4.2.7",
"react-blockies": "^1.4.1",
Expand Down
7 changes: 3 additions & 4 deletions src/common/Section/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ const Section: React.FC<SectionProps & Partial<SectionContainerProps>> = ({
const HeaderComp: React.FC<CustomHeaderProps> = (props: CustomHeaderProps) => {
const Comp = () => hdr as React.ReactNode;
if(props.children){
<Comp>
return (<Comp>
{children}
</Comp>
</Comp>)
} else {
return <Comp { ...props } />
return (<Comp { ...props } /> )
}
};
// const CustomHeaderComp: = (props: CustomHeaderType) => <HeaderComp { ...props} />;
Expand All @@ -52,4 +52,3 @@ export default Section;




27 changes: 27 additions & 0 deletions src/env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/// <reference types="vite/client" />

interface ImportMetaEnv {
readonly VITE_APP_TITLE: string
readonly VITE_BACKEND_API_URL: string;
readonly NPM_TOKEN: string;
readonly GSAP_TOKEN: string;
readonly VITE_RPC_PROVIDER_ALCHEMY: string;
readonly VITE_WALLET_CONNECT_ID: string;

readonly VITE_FIREBASE_API_KEY: string
readonly VITE_FIREBASE_AUTH_DOMAIN: string
readonly VITE_FIREBASE_DB_URL: string
readonly VITE_FIREBASE_PROJECT_ID: string
readonly VITE_FIREBASE_STORAGE_BUCKET: string
readonly VITE_FIREBASE_MESSAGING_SENDER_ID: number;
readonly VITE_FIREBASE_APP_ID: string
// more env variables...
}

interface ImportMeta {
readonly env: ImportMetaEnv
}

interface Window {
ethereum?: any
}
12 changes: 6 additions & 6 deletions src/hooks/useDrand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@ import { useGetRandomNumberQuery } from '../components/CreateGameCard/apiSlice';
export function useDrand() {
const randomness = useGetRandomNumberQuery(undefined);
// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
const [drandInLocalStorage, _] = useState<string | null>(window.localStorage.getItem('drand'));
const [drandInLocalStorage, _] = useState<string>(window.localStorage.getItem('drand') ?? '');
const [currentDrand, setCurrentDrand] = useState<any>(null);

useEffect(() => {
if(!drandInLocalStorage && randomness?.data) {
if(drandInLocalStorage.length === 0 && randomness?.data) {
setCurrentDrand(randomness.data);
setTimeout(() => {
randomness.refetch();
}, (60 * 1000) * 3);
} else if (drandInLocalStorage && randomness?.data) {
} else if (drandInLocalStorage.length > 0 && randomness?.data) {
setCurrentDrand(JSON.parse(drandInLocalStorage));
window.localStorage.setItem('drand', JSON.stringify(randomness?.data))
window.localStorage.setItem('drand', JSON.stringify(randomness?.data ?? ''))
}
if(drandInLocalStorage && (randomness.data && randomness.data?.round === JSON.parse(drandInLocalStorage).round)){
if(drandInLocalStorage.length > 0 && (randomness.data && randomness.data?.round === JSON.parse(drandInLocalStorage).round)){
setTimeout(() => {
randomness.refetch();
}, (60 * 1000) * 3);
} else {
window.localStorage.setItem('drand', JSON.stringify(randomness?.data))
window.localStorage.setItem('drand', JSON.stringify(randomness?.data ?? ''))
}
}, [randomness?.data, randomness?.isLoading, setCurrentDrand]);

Expand Down
2 changes: 1 addition & 1 deletion src/libs/firebase/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { initializeApp } from 'firebase/app'
import { getDatabase } from 'firebase/database'

console.log(import.meta.env);
const firebaseConfig = {
apiKey: import.meta.env.VITE_FIREBASE_API_KEY,
authDomain: import.meta.env.VITE_FIREBASE_AUTH_DOMAIN,
Expand Down
6 changes: 0 additions & 6 deletions src/vite-env.d.ts

This file was deleted.

15 changes: 11 additions & 4 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
import { defineConfig, loadEnv } from 'vite'
import { resolve } from 'path';
import react from '@vitejs/plugin-react';
import mkcert from 'vite-plugin-mkcert'

// https://vitejs.dev/config/
export default ({ mode }) => {

console.log(mode)
process.env = { ...process.env, ...loadEnv(mode, process.cwd())};
return defineConfig({
server: { https: true },
// server: { https: true },
build: {
outDir: "./dist",
rollupOptions: {
input: {
main: resolve(__dirname, 'index.html'),
},
},
},
optimizeDeps: {
esbuildOptions: {
target: 'es2020',
Expand All @@ -23,7 +31,6 @@ export default ({ mode }) => {
plugins: ['babel-plugin-macros', 'babel-plugin-styled-components']
}
}),
mkcert()
],
})

Expand Down

0 comments on commit 44f5bdb

Please sign in to comment.