From 419a94a84e245f20256e9eff364f9e394234a3b9 Mon Sep 17 00:00:00 2001 From: simmmpleweb Date: Wed, 13 Sep 2023 16:58:28 +0300 Subject: [PATCH 1/3] Avatar rtl --- src/app/rtl/rtl-default/page.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/rtl/rtl-default/page.tsx b/src/app/rtl/rtl-default/page.tsx index ac64145..3375bec 100644 --- a/src/app/rtl/rtl-default/page.tsx +++ b/src/app/rtl/rtl-default/page.tsx @@ -23,6 +23,7 @@ // Chakra imports import { + Avatar, Box, Flex, Icon, @@ -97,7 +98,7 @@ export default function UserReports() { - + } endContent={ From b2456b2ede44ee7e5de5816b0afbf9cea9089137 Mon Sep 17 00:00:00 2001 From: simmmpleweb Date: Wed, 13 Sep 2023 16:58:44 +0300 Subject: [PATCH 2/3] Added src --- src/app/rtl/rtl-default/page.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/rtl/rtl-default/page.tsx b/src/app/rtl/rtl-default/page.tsx index 3375bec..866b0ce 100644 --- a/src/app/rtl/rtl-default/page.tsx +++ b/src/app/rtl/rtl-default/page.tsx @@ -98,7 +98,7 @@ export default function UserReports() { - + } endContent={ From 2324b6eeb7e2dbfb45cc0806273fb349ddd68867 Mon Sep 17 00:00:00 2001 From: simmmpleweb Date: Fri, 10 Nov 2023 20:08:55 +0200 Subject: [PATCH 3/3] Build errors fixed --- CHANGELOG.md | 8 +- src/app/rtl/rtl-default/page.tsx | 1 - src/components/card/NFT.tsx | 310 +++++++++--------- src/components/charts/BarChart.tsx | 55 ++-- src/components/charts/LineAreaChart.tsx | 64 ++-- src/components/charts/LineChart.tsx | 30 +- src/components/charts/PieChart.tsx | 55 ++-- src/components/image/Avatar.tsx | 36 -- src/components/image/Image.tsx | 15 - src/components/navbar/NavbarLinksAdmin.tsx | 10 +- src/components/sidebar/Sidebar.tsx | 86 ++--- .../sidebar/components/SidebarCard.tsx | 12 +- .../marketplace/components/HistoryItem.tsx | 14 +- src/views/admin/profile/components/Banner.tsx | 93 +++--- .../admin/profile/components/Project.tsx | 6 +- 15 files changed, 357 insertions(+), 438 deletions(-) delete mode 100644 src/components/image/Avatar.tsx delete mode 100644 src/components/image/Image.tsx diff --git a/CHANGELOG.md b/CHANGELOG.md index fc22ced..8debeaf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,10 @@ -# Changelog + +## [2.1.0] 2023-11-10 + +### Bug fix - Build error due to Types + +- Updated types +- Updated charts ## [2.0.0] 2023-09-13 ### Big update - NextJS 13 Update diff --git a/src/app/rtl/rtl-default/page.tsx b/src/app/rtl/rtl-default/page.tsx index 866b0ce..65d0d72 100644 --- a/src/app/rtl/rtl-default/page.tsx +++ b/src/app/rtl/rtl-default/page.tsx @@ -37,7 +37,6 @@ import Usa from '/public/img/dashboards/usa.png'; // import MiniCalendar from 'components/calendar/MiniCalendar'; import MiniStatistics from 'components/card/MiniStatistics'; import IconBox from 'components/icons/IconBox'; -import { ChakraNextAvatar } from 'components/image/Avatar'; import { MdAddTask, MdAttachMoney, diff --git a/src/components/card/NFT.tsx b/src/components/card/NFT.tsx index c1cf37b..895c3de 100644 --- a/src/components/card/NFT.tsx +++ b/src/components/card/NFT.tsx @@ -1,163 +1,171 @@ // Chakra imports import { - AvatarGroup, - Avatar, - Box, - Button, - Flex, - Icon, - Link, - Text, - useColorModeValue, - Spacer, - AspectRatio + AvatarGroup, + Avatar, + Box, + Button, + Flex, + Icon, + Image, + Link, + Text, + useColorModeValue, + AspectRatio, } from '@chakra-ui/react'; // Custom components import Card from 'components/card/Card'; -import { NextAvatar } from 'components/image/Avatar'; -import { Image } from 'components/image/Image'; // Assets import { useState } from 'react'; import { IoHeart, IoHeartOutline } from 'react-icons/io5'; export default function NFT(props: { - image: string; - name: string; - author: string; - bidders: string[]; - download: string; - currentbid: string | number; + image: string | any; + name: string; + author: string; + bidders: string[] | any[]; + download: string; + currentbid: string | number; }) { - const { image, name, author, bidders, download, currentbid } = props; - const [ like, setLike ] = useState(false); - const textColor = useColorModeValue('navy.700', 'white'); - const textColorBid = useColorModeValue('brand.500', 'white'); - return ( - - - - - - - - - - - - - {name} - - - {author} - - - - {bidders.map((avt, key) => )} - - - - - Current Bid: {currentbid} - - - - - - - - - ); + const { image, name, author, bidders, download, currentbid } = props; + const [like, setLike] = useState(false); + const textColor = useColorModeValue('navy.700', 'white'); + const textColorBid = useColorModeValue('brand.500', 'white'); + return ( + + + + + + + + + + + + + {name} + + + {author} + + + + {bidders.map((avt, key) => ( + + ))} + + + + + Current Bid: {currentbid} + + + + + + + + + ); } diff --git a/src/components/charts/BarChart.tsx b/src/components/charts/BarChart.tsx index 96bc882..ad40638 100644 --- a/src/components/charts/BarChart.tsx +++ b/src/components/charts/BarChart.tsx @@ -1,38 +1,23 @@ -import dynamic from 'next/dist/shared/lib/dynamic' -import React from 'react' -import { isWindowAvailable } from 'utils/navigation' -import { ChartProps, ChartState } from './LineAreaChart' -const Chart = dynamic(() => import('react-apexcharts'), { ssr: false }) +'use client'; +import dynamic from 'next/dynamic'; +// import Chart from 'react-apexcharts'; +const Chart = dynamic(() => import('react-apexcharts'), { + ssr: false, +}); -class ColumnChart extends React.Component { - constructor (props: ChartState) { - super(props) - this.state = { - chartData: [], - chartOptions: {} - } - } +const BarChart = (props: any) => { + const { chartData, chartOptions } = props; - componentDidMount () { - this.setState({ - chartData: this.props.chartData, - chartOptions: this.props.chartOptions - }) - } + return ( + // @ts-expect-error + + ); +}; - render () { - if (!isWindowAvailable()) return <> - - return ( - - ) - } -} - -export default ColumnChart +export default BarChart; diff --git a/src/components/charts/LineAreaChart.tsx b/src/components/charts/LineAreaChart.tsx index e60635f..9a27a72 100644 --- a/src/components/charts/LineAreaChart.tsx +++ b/src/components/charts/LineAreaChart.tsx @@ -1,47 +1,23 @@ -import { ApexOptions } from 'apexcharts' -import dynamic from 'next/dist/shared/lib/dynamic' -import React from 'react' -import { isWindowAvailable } from 'utils/navigation' -const Chart = dynamic(() => import('react-apexcharts'), { ssr: false }) +'use client'; +import dynamic from 'next/dynamic'; +// import Chart from 'react-apexcharts'; +const Chart = dynamic(() => import('react-apexcharts'), { + ssr: false, +}); -export type ChartState = { - chartData: ApexAxisChartSeries | ApexNonAxisChartSeries - chartOptions: ApexOptions -} +const LineAreaChart = (props: any) => { + const { chartData, chartOptions } = props; -export type ChartProps = ChartState & { - [x: string]: any -} + return ( + // @ts-expect-error + + ); +}; -class LineChart extends React.Component { - state: ChartState = { - chartData: [], - chartOptions: {} - } - - constructor (props: ChartProps) { - super(props) - } - - componentDidMount () { - this.setState({ - chartData: this.props.chartData, - chartOptions: this.props.chartOptions - }) - } - - render () { - if (!isWindowAvailable()) return <> - return ( - - ) - } -} - -export default LineChart +export default LineAreaChart; diff --git a/src/components/charts/LineChart.tsx b/src/components/charts/LineChart.tsx index e059f6a..6d0f1b0 100644 --- a/src/components/charts/LineChart.tsx +++ b/src/components/charts/LineChart.tsx @@ -1,21 +1,23 @@ -import dynamic from 'next/dist/shared/lib/dynamic' -import { ChartProps } from './LineAreaChart' +'use client'; +import dynamic from 'next/dynamic'; +// import Chart from 'react-apexcharts'; +const Chart = dynamic(() => import('react-apexcharts'), { + ssr: false, +}); -const Chart = dynamic(() => import('react-apexcharts'), { ssr: false }) +const LineChart = (props: any) => { + const { chartData, chartOptions } = props; -interface LineChartProps extends ChartProps {} - -export default function LineChart ({ - chartOptions, - chartData -}: LineChartProps) { return ( + // @ts-expect-error - ) -} + ); +}; + +export default LineChart; diff --git a/src/components/charts/PieChart.tsx b/src/components/charts/PieChart.tsx index 877a088..00d9dfb 100644 --- a/src/components/charts/PieChart.tsx +++ b/src/components/charts/PieChart.tsx @@ -1,38 +1,23 @@ -import dynamic from 'next/dist/shared/lib/dynamic' -import React from 'react' -import { isWindowAvailable } from 'utils/navigation' -import { ChartProps, ChartState } from './LineAreaChart' -const Chart = dynamic(() => import('react-apexcharts'), { ssr: false }) +'use client'; +import dynamic from 'next/dynamic'; +// import Chart from 'react-apexcharts'; +const Chart = dynamic(() => import('react-apexcharts'), { + ssr: false, +}); -class PieChart extends React.Component { - state: ChartState = { - chartData: [], - chartOptions: {} - } +const PieChart = (props: any) => { + const { chartData, chartOptions } = props; - constructor (props: ChartProps) { - super(props) - } + return ( + // @ts-expect-error + + ); +}; - componentDidMount () { - this.setState({ - chartData: this.props.chartData, - chartOptions: this.props.chartOptions - }) - } - - render () { - if (!isWindowAvailable()) return <> - return ( - - ) - } -} - -export default PieChart +export default PieChart; diff --git a/src/components/image/Avatar.tsx b/src/components/image/Avatar.tsx deleted file mode 100644 index 92623c0..0000000 --- a/src/components/image/Avatar.tsx +++ /dev/null @@ -1,36 +0,0 @@ -import { chakra, useColorMode } from '@chakra-ui/system' -import { ComponentProps } from 'react' -import { Image } from './Image' - -interface AvatarImageProps extends ComponentProps { - showBorder?: boolean -} - -export function NextAvatar ({ - src, - showBorder, - alt, - style, - ...props -}: AvatarImageProps) { - const { colorMode } = useColorMode() - - return ( - {alt} - ) -} - -export const ChakraNextAvatar = chakra(NextAvatar, { - shouldForwardProp: prop => ['width', 'height', 'src', 'alt'].includes(prop) -}) diff --git a/src/components/image/Image.tsx b/src/components/image/Image.tsx deleted file mode 100644 index 782d585..0000000 --- a/src/components/image/Image.tsx +++ /dev/null @@ -1,15 +0,0 @@ -import { Box, ChakraComponent } from '@chakra-ui/react' -import * as React from 'react' -import NextImage from 'next/image' -import { ComponentProps } from 'react' - -interface ImageProps extends ComponentProps> {} - -export const Image = (props: ImageProps) => { - const { src, alt, ...rest } = props - return ( - - - - ) -} diff --git a/src/components/navbar/NavbarLinksAdmin.tsx b/src/components/navbar/NavbarLinksAdmin.tsx index 5ab47b1..99a8a8e 100644 --- a/src/components/navbar/NavbarLinksAdmin.tsx +++ b/src/components/navbar/NavbarLinksAdmin.tsx @@ -6,6 +6,7 @@ import { Center, Flex, Icon, + Image, Link, Menu, MenuButton, @@ -16,7 +17,6 @@ import { useColorModeValue, } from '@chakra-ui/react'; // Custom Components -import { Image } from 'components/image/Image'; import { ItemContent } from 'components/menu/ItemContent'; import { SearchBar } from 'components/navbar/searchBar/SearchBar'; import { SidebarResponsive } from 'components/sidebar/Sidebar'; @@ -26,7 +26,11 @@ import { FaEthereum } from 'react-icons/fa'; import { IoMdMoon, IoMdSunny } from 'react-icons/io'; import { MdInfoOutline, MdNotificationsNone } from 'react-icons/md'; import routes from 'routes'; -export default function HeaderLinks(props: { secondary: boolean }) { +export default function HeaderLinks(props: { + secondary: boolean; + onOpen: boolean | any; + fixed: boolean | any; +}) { const { secondary } = props; const { colorMode, toggleColorMode } = useColorMode(); // Chakra Color Mode @@ -181,7 +185,7 @@ export default function HeaderLinks(props: { secondary: boolean }) { minW={{ base: 'unset' }} maxW={{ base: '360px', md: 'unset' }} > - +