diff --git a/src/views/Nft/component/FlexText.tsx b/src/views/Nft/component/FlexText.tsx new file mode 100644 index 0000000..5c22e49 --- /dev/null +++ b/src/views/Nft/component/FlexText.tsx @@ -0,0 +1,17 @@ +import React, { useState } from 'react' +import styled from 'styled-components' +// import SearchInput from 'components/SearchInput' +import SwiperCore, { Keyboard, Mousewheel, Pagination } from 'swiper' +import { Swiper, SwiperSlide } from 'swiper/react' +import { Card, Button, Text, Flex, Image } from '@pancakeswap/uikit' + +export default function FlexText({name,value}){ + + return( + + { name }: + { value } + + ) + +} \ No newline at end of file diff --git a/src/views/Nft/component/StepCom.tsx b/src/views/Nft/component/StepCom.tsx new file mode 100644 index 0000000..e3fd125 --- /dev/null +++ b/src/views/Nft/component/StepCom.tsx @@ -0,0 +1,27 @@ +import React, { useState } from 'react' +import styled from 'styled-components' +import { Text, Flex, Image } from '@pancakeswap/uikit' + +export default function StepCom(){ + + const [valNumber, setInputState] = useState(1) + + const onAdd = (type) => { + if (type === 'add') { + setInputState(valNumber + 1) + } else { + if (valNumber === 0) return + setInputState(valNumber - 1) + } + + } + + return( + + onAdd('sub')} width={25} height={25} /> + {valNumber} + 1 onAdd('add')} width={25} height={25} /> + + ) + +} \ No newline at end of file diff --git a/src/views/Nft/index.tsx b/src/views/Nft/index.tsx index 3b99031..49cfe61 100644 --- a/src/views/Nft/index.tsx +++ b/src/views/Nft/index.tsx @@ -5,6 +5,12 @@ import SwiperCore, { Keyboard, Mousewheel, Pagination } from 'swiper' import { Swiper, SwiperSlide } from 'swiper/react' import { Card, Button, Text, Flex, Image } from '@pancakeswap/uikit' + +import FlexText from './component/FlexText' +// import Step from './component/Step' + +import StepCom from './component/StepCom' + import 'swiper/swiper.min.css' import 'swiper/components/pagination/pagination.min.css'; @@ -75,11 +81,8 @@ const Divs = styled.div` background: ${({ theme }) => theme.colors.gradients.bubblegum}; ` -const DetailInfo = styled.div` +const DetailInfo = styled(Flex)` padding:0 21px; - display: flex; - align-items: center; - justify-content: space-between; margin-top:24px; ` @@ -105,17 +108,7 @@ const SwiperDiv = styled(Swiper)` const Nft: React.FC = () => { - const [valNumber, setInputState] = useState(1) const [blindboxList] = useState([{ id: 1 }, { id: 2 }, { id: 3 }]) - const onAdd = (type) => { - if (type === 'add') { - setInputState(valNumber + 1) - } else { - if (valNumber === 0) return - setInputState(valNumber - 1) - } - - } return ( @@ -132,37 +125,24 @@ const Nft: React.FC = () => { - - 系列 - 法式盛宴 + + 系列 + 法式盛宴 - - 价格 - + + 价格 + 500 - 黄油 + 黄油 - - 数量 - - onAdd('sub')} width={25} height={25} /> - {valNumber} - 1 onAdd('add')} width={25} height={25} /> - + + 数量 + - - 钱包中的 BUTTER: - 0 - - - 回收点数抵扣: - 0 - - - 实际黄油成本: - 0 - + + +