123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- import React, { useState } from 'react'
- import { Button, Typography } from 'antd'
- const { Text } = Typography
- const { Title } = Typography
- export const SpoilerButton = ({ text, children, style }) => {
- const [opened, setOpened] = useState(false)
- return (
- <>
-
-
- <Button
- onClick={() => {
- setOpened(!opened)
- }}
- style={style}
- >
- {text}
- </Button>
- {opened && children}
- </>
- )
- }
- export const ReplyButton = ({ text, children, style }) => {
- const [opened, setOpened] = useState(false)
- return (
- <>
- <Text
- type="secondary"
- strong
- className="ButtonComment"
- onClick={() => {
- setOpened(!opened)
- }}
- style={style}
- >
- {text}
- </Text>
- {opened && children}
- </>
- )
- }
- export const ViewComment = ({ text, count, children, style,textClosed }) => {
- const [opened, setOpened] = useState(false)
- return (
- <>
- <Text
- type="secondary"
- strong
- // level={1}
- style={{fontSize:'14px'}}
- className="ButtonComment"
- onClick={() => {
- setOpened(!opened)
- }}
- // style={style}
- >
- { !opened ? text + count + ' comments' : textClosed}
- </Text>
- {<div className={opened && children ? 'ScrollForFeed' : 'WithOutScroll'}>
- {opened && children}
- </div>
- }
- </>
- )
- }
|