feat: added seed

This commit is contained in:
2023-07-05 22:43:48 -03:00
parent 2d0f960d49
commit 201f55a1b8
22 changed files with 204 additions and 34 deletions

View File

@@ -1,9 +1,9 @@
import React from 'react';
import Chart from 'react-google-charts';
import styled, { useTheme } from 'styled-components';
import { capitalize } from 'utils';
import { type Theme } from '@/lib/theme';
import { type PieCircleData } from '@/lib/types';
import { capitalize } from '@/lib/utils';
export const PieCircle = (props: { pieCircleData: PieCircleData }): JSX.Element => {
const { pieCircleData } = props;

View File

@@ -1,3 +0,0 @@
export const SPEND_SCREEN_ID = 'spend-screen';
export const SPEND_SCREEN_NAME = 'Spend';
export const APP_NAME = 'SpendIA';

View File

@@ -1,12 +1,12 @@
/* eslint-disable @typescript-eslint/ban-types */
import { create } from 'zustand';
import { SPEND_SCREEN_ID, SPEND_SCREEN_NAME } from 'utils/constants';
import { type UserSpendData, type Tab } from '@/lib/types';
import { SPEND_SCREEN_ID, SPEND_SCREEN_NAME } from '@/lib/constants';
interface appStore {
tab: Tab;
setTab: (props: Tab) => void;
setUserSpendData: (props: UserSpendData[]) => void;
tab: Tab;
userSpendData: UserSpendData[];
}

View File

@@ -1,3 +1,4 @@
/* eslint-disable typescript-sort-keys/interface */
/* eslint-disable sort-keys-fix/sort-keys-fix */
export interface Theme {
colors: {

View File

@@ -9,8 +9,8 @@ interface Currency {
}
interface Category {
label: string;
backgroundColor: string;
label: string;
}
export interface UserSpendData {

View File

@@ -1 +0,0 @@
export const capitalize = (str: string): string => str.charAt(0).toUpperCase() + str.slice(1);

View File

@@ -1,13 +1,8 @@
{
"name": "spendia",
"name": "client",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts.backup": {
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview"
},
"scripts": {
"dev": "next dev -p 8080",
"build": "next build",

View File

@@ -1,9 +1,9 @@
import React from 'react';
import Head from 'next/head';
import styled, { ThemeProvider } from 'styled-components';
import { APP_NAME, SPEND_SCREEN_ID } from 'utils/constants';
import { Header, SpendScreen } from '@/screens';
import { type Tab } from '@/lib/types';
import { APP_NAME, SPEND_SCREEN_ID } from '@/lib/constants';
import { useAppStore } from '@/lib/storage';
import theme from '@/lib/theme';

View File

@@ -1,4 +1,4 @@
import { SPEND_SCREEN_ID, SPEND_SCREEN_NAME } from '../../lib/constants';
import { SPEND_SCREEN_ID, SPEND_SCREEN_NAME } from 'utils/constants';
import { type Tab } from '../../lib/types';
export const tabs: Tab[] = [

View File

@@ -4,7 +4,7 @@ import { PieCircle } from '@/components';
import { type Theme } from '@/lib/theme';
import { useAppStore } from '@/lib/storage';
import { type PieCircleData } from '@/lib/types';
import { trpc } from '../../trpc';
import { trpc } from '@/trpc';
export const SpendScreen = (): JSX.Element => {
const userSpendData = useAppStore((state) => state.userSpendData);

View File

@@ -1,18 +1,12 @@
{
"extends": "../../tsconfig.json",
"files": [
"../server/app.ts"
],
"files": ["../server/app.ts"],
"compilerOptions": {
"rootDir": "../",
"composite": true,
"target": "ESNext",
"useDefineForClassFields": true,
"lib": [
"DOM",
"DOM.Iterable",
"ESNext"
],
"lib": ["DOM", "DOM.Iterable", "ESNext"],
"allowJs": false,
"skipLibCheck": true,
"allowSyntheticDefaultImports": true,
@@ -27,9 +21,7 @@
"incremental": true,
"baseUrl": ".",
"paths": {
"@/*": [
"./*"
]
"@/*": ["./*"]
},
"plugins": [
{
@@ -51,8 +43,5 @@
"path": "./tsconfig.node.json"
}
],
"exclude": [
"node_modules",
"../server/app.ts"
]
"exclude": ["node_modules"]
}