Skip to content

Commit

Permalink
styles edits for collection/deck list, reusable components and view c…
Browse files Browse the repository at this point in the history
…hange state. extensive codebade clean up.
  • Loading branch information
reedoooo committed Mar 28, 2024
1 parent 557c2ee commit 12b730b
Show file tree
Hide file tree
Showing 141 changed files with 2,511 additions and 15,186 deletions.
13 changes: 5 additions & 8 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
DeckProvider,
CartProvider,
ChartProvider,
StatisticsProvider,
SidebarProvider,
AppContextProvider,
useAuthContext,
Expand Down Expand Up @@ -53,13 +52,11 @@ const App = () => {
<DeckProvider>
<CartProvider>
<ChartProvider>
<StatisticsProvider>
<SidebarProvider>
<AppContextProvider>
<Main />
</AppContextProvider>
</SidebarProvider>
</StatisticsProvider>
<SidebarProvider>
<AppContextProvider>
<Main />
</AppContextProvider>
</SidebarProvider>
</ChartProvider>
</CartProvider>
</DeckProvider>
Expand Down
71 changes: 71 additions & 0 deletions src/assets/currentlyUnused/CardDetail.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
// import React from 'react';
// import { Box, Typography, Chip } from '@mui/material';
// import { useMode } from '../../context';
// import {
// CardDetailContainer,
// CardIconWrapper,
// CardTitleStyle,
// CardValueStyle,
// } from './styles/cardStyles';
// import MDTypography from '../../layout/REUSABLE_COMPONENTS/MDTYPOGRAPHY/MDTypography';

// const CardDetail = ({
// title,
// values,
// value,
// className,
// onRarityClick,
// icon,
// }) => {
// const { theme } = useMode();

// const getChipColor = (rarity) => {
// return theme.palette.rarity[rarity] || theme.palette.grey[500];
// };

// return (
// <CardDetailContainer className={className}>
// <Box
// className={className}
// sx={{
// display: 'flex',
// alignItems: 'center',
// // gap: 1,
// flexWrap: 'wrap',
// mx: 'auto',
// background: theme.palette.chartTheme.primary.default,
// }}
// >
// {icon && <CardIconWrapper>{icon}</CardIconWrapper>}
// <MDTypography variant="h5" sx={{ mr: 1 }}>
// {title}:
// </MDTypography>

// {value && (
// <MDTypography variant="body1" sx={{ color: theme.palette.text.main }}>
// {value}
// </MDTypography>
// )}
// {Array.isArray(values) &&
// values.length > 0 &&
// values.map((rarityValue, index) => (
// <Chip
// key={index}
// label={rarityValue || ''}
// onClick={() => onRarityClick(rarityValue?.toString())}
// sx={{
// borderColor: getChipColor(rarityValue?.toString()),
// borderWidth: '2px',
// fontWeight: 700,
// color: getChipColor(rarityValue?.toString()),
// margin: '5px',
// }}
// variant="outlined"
// />
// ))}
// </Box>
// </CardDetailContainer>
// );
// };

// export default CardDetail;
20 changes: 20 additions & 0 deletions src/assets/currentlyUnused/ChartWrapper.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// import React from 'react';

// const ChartWrapper = ({ theme, children, ...rest }) => {
// const chartStyle = {
// display: 'flex',
// alignItems: 'center',
// justifyContent: 'center',
// marginBottom: theme.lenLg1,
// height: theme.heightChartMd,
// width: '100%',
// };

// return (
// <div style={chartStyle} {...rest}>
// {children}
// </div>
// );
// };

// export default ChartWrapper;
54 changes: 54 additions & 0 deletions src/assets/currentlyUnused/CronJobContext/CronJobContext.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// import React, { createContext, useContext, useEffect, useState } from 'react';
// import { useUserContext } from '../../MAIN_CONTEXT/UserContext/UserContext';
// import { useCollectionStore } from '../../MAIN_CONTEXT/CollectionContext/CollectionContext';
// import { useCombinedContext } from '../../MISC_CONTEXT/CombinedContext/CombinedProvider';

// const CronJobContext = createContext();

// export const useCronJobContext = () => useContext(CronJobContext);

// export const CronJobProvider = ({ children }) => {
// const { user, userId } = useUserContext();
// const { selectedCollection } = useCollectionStore(); // Assuming this is where you get your selectedCollection
// // const { handleSendAllCardsInCollections, listOfMonitoredCards } =
// // useCombinedContext();
// const [lastCronJobTriggerTime, setLastCronJobTriggerTime] = useState(
// new Date().getTime()
// );

// // useEffect(() => {
// // const handleTriggerCronJob = () => {
// // const currentTime = new Date().getTime();
// // const timeDifference = currentTime - lastCronJobTriggerTime;

// // if (
// // timeDifference >= 120000 &&
// // listOfMonitoredCards.length > 5 &&
// // selectedCollection?.chartData?.allXYValues?.length > 10
// // ) {
// // setLastCronJobTriggerTime(currentTime);
// // if (userId) {
// // console.log('Triggering cron job actions');
// // handleSendAllCardsInCollections(userId, listOfMonitoredCards);
// // }
// // }
// // };

// // const interval = setInterval(handleTriggerCronJob, 120000); // Trigger every 2 minutes (120000 ms)
// // return () => clearInterval(interval);
// // }, [
// // lastCronJobTriggerTime,
// // user,
// // listOfMonitoredCards,
// // selectedCollection,
// // handleSendAllCardsInCollections,
// // ]);

// return (
// <CronJobContext.Provider
// value={{ lastCronJobTriggerTime, setLastCronJobTriggerTime }}
// >
// {children}
// </CronJobContext.Provider>
// );
// };
75 changes: 75 additions & 0 deletions src/assets/currentlyUnused/MDAVATAR/MDAvatarRoot.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
// import Avatar from '@mui/material/Avatar';
// import styled from 'styled-components';
// import { useMode } from '../../../context';

// export default styled(Avatar)(({ ownerState }) => {
// const { theme } = useMode();
// const { palette, functions, typography, boxShadows } = theme;
// const { shadow, bgColor, size } = ownerState;

// const { gradients, transparent, white } = palette;
// const { pxToRem, linearGradient } = functions;
// const { size: fontSize, fontWeightRegular } = typography;

// // backgroundImage value
// const backgroundValue =
// bgColor === 'transparent'
// ? transparent.main
// : linearGradient(gradients[bgColor].main, gradients[bgColor].state);

// // size value
// let sizeValue;

// switch (size) {
// case 'xs':
// sizeValue = {
// width: pxToRem(24),
// height: pxToRem(24),
// fontSize: fontSize.xs,
// };
// break;
// case 'sm':
// sizeValue = {
// width: pxToRem(36),
// height: pxToRem(36),
// fontSize: fontSize.sm,
// };
// break;
// case 'lg':
// sizeValue = {
// width: pxToRem(58),
// height: pxToRem(58),
// fontSize: fontSize.sm,
// };
// break;
// case 'xl':
// sizeValue = {
// width: pxToRem(74),
// height: pxToRem(74),
// fontSize: fontSize.md,
// };
// break;
// case 'xxl':
// sizeValue = {
// width: pxToRem(110),
// height: pxToRem(110),
// fontSize: fontSize.md,
// };
// break;
// default: {
// sizeValue = {
// width: pxToRem(48),
// height: pxToRem(48),
// fontSize: fontSize.md,
// };
// }
// }

// return {
// background: backgroundValue,
// color: white.main,
// fontWeight: fontWeightRegular,
// boxShadow: boxShadows[shadow],
// ...sizeValue,
// };
// });
31 changes: 31 additions & 0 deletions src/assets/currentlyUnused/PopoverContext/PopoverContext.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// import React, { createContext, useState } from 'react';

// export const PopoverContext = createContext({
// hoveredCard: null,
// isPopoverOpen: false,
// // eslint-disable-next-line @typescript-eslint/no-empty-function
// setHoveredCard: () => {},
// // eslint-disable-next-line @typescript-eslint/no-empty-function
// setIsPopoverOpen: () => {},
// });

// export const PopoverProvider = ({ children }) => {
// const [hoveredCard, setHoveredCard] = useState(null);
// const [isPopoverOpen, setIsPopoverOpen] = useState(false);
// // const [clickedCard, setClickedCard] = useState(null);

// const value = {
// hoveredCard,
// isPopoverOpen,
// setHoveredCard,
// setIsPopoverOpen,
// };

// return (
// <PopoverContext.Provider value={value}>{children}</PopoverContext.Provider>
// );
// };

// export const usePopoverContext = () => {
// return React.useContext(PopoverContext);
// };
89 changes: 89 additions & 0 deletions src/assets/currentlyUnused/SimplePieChart.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
// import React, { useState, useEffect, useContext } from 'react';
// import Chart from 'react-apexcharts';
// import { ThemeContext } from '../../../context/ThemeContext'; // Adjust the path as necessary
// import { Card, InfoStack } from '../../../';

// const Wrapper = ({ cardTitle, value, label, series }) => {
// const theme = useContext(ThemeContext); // Assuming theme is provided through context

// const cardStyle = {
// height: theme.heightCardMd,
// minHeight: theme.heightCardMd,
// maxHeight: theme.heightCardMd,
// };

// const chartStyle = {
// position: 'relative',
// display: 'flex',
// alignItems: 'center',
// justifyContent: 'center',
// marginBottom: theme.lenLg1,
// height: theme.heightChartMd,
// transform: 'translateX(0)',
// marginTop: '2rem',
// };

// const chartWrapperStyle = {
// position: 'absolute',
// top: '50%',
// left: '50%',
// transform: 'translate(-50%, -50%)',
// minWidth: '240px',
// };

// const [options, setOptions] = useState({
// chart: {
// animations: {
// enabled: false,
// },
// },
// grid: {
// padding: {
// top: 40,
// left: 0,
// right: 0,
// bottom: 20,
// },
// },
// stroke: {
// show: false,
// },
// tooltip: { enabled: false },
// legend: { show: false },
// dataLabels: { enabled: false },
// plotOptions: { pie: { donut: { size: '75%' } } },
// });

// useEffect(() => {
// if (theme) {
// setOptions((prevOptions) => ({
// ...prevOptions,
// colors: [
// theme.colorPrimary,
// theme.colorAccent,
// theme.colorDefaultBackground,
// ],
// }));
// }
// }, [theme]);

// return (
// <Card style={cardStyle} cardTitle={cardTitle}>
// <InfoStack value={value} label={label} />
// <div style={chartStyle}>
// <div style={chartWrapperStyle}>
// {options.colors && (
// <Chart
// options={options}
// series={series}
// type="donut"
// width="100%"
// />
// )}
// </div>
// </div>
// </Card>
// );
// };

// export default Wrapper;
Loading

0 comments on commit 12b730b

Please sign in to comment.