-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
styles edits for collection/deck list, reusable components and view c…
…hange state. extensive codebade clean up.
- Loading branch information
Showing
141 changed files
with
2,511 additions
and
15,186 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
54
src/assets/currentlyUnused/CronJobContext/CronJobContext.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
// ); | ||
// }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
// }; | ||
// }); |
File renamed without changes.
31 changes: 31 additions & 0 deletions
31
src/assets/currentlyUnused/PopoverContext/PopoverContext.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
// }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
File renamed without changes.
Oops, something went wrong.