trepur_components 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/lib/components/Accordion/index.js +3 -1
- package/dist/src/lib/components/Accordion/index.js.map +1 -1
- package/dist/src/lib/components/Accordion/style.module.css +4 -0
- package/dist/src/lib/components/Accordion/style.module.css.map +1 -0
- package/dist/src/lib/components/Carousel/index.d.ts +0 -1
- package/dist/src/lib/components/Carousel/index.js +1 -1
- package/dist/src/lib/components/Carousel/index.js.map +1 -1
- package/dist/src/lib/components/ImageLinkList/index.d.ts +1 -1
- package/dist/src/lib/components/Nav/index.d.ts +1 -1
- package/dist/src/lib/components/Nav/index.js +2 -2
- package/dist/src/lib/components/Nav/index.js.map +1 -1
- package/dist/src/lib/components/SocialBlock/index.js +2 -2
- package/dist/src/lib/components/SocialBlock/index.js.map +1 -1
- package/dist/{components → src/lib/components}/Timeline/index.css +2 -0
- package/dist/src/lib/components/Timeline/index.css.map +1 -0
- package/dist/{components → src/lib/components}/Tubestops/index.css +35 -30
- package/dist/src/lib/components/Tubestops/index.css.map +1 -0
- package/dist/src/lib/typography/index.d.ts +1 -3
- package/dist/src/lib/typography/index.js +1 -1
- package/dist/src/lib/typography/index.js.map +1 -1
- package/package.json +13 -6
- package/dist/components/Accordion/Accordion.stories.tsx +0 -88
- package/dist/components/Accordion/index.tsx +0 -31
- package/dist/components/AlertBar/AlertBar.stories.tsx +0 -105
- package/dist/components/AlertBar/index.tsx +0 -127
- package/dist/components/Breadcrumbs/Breadcrumbs.stories.tsx +0 -60
- package/dist/components/Breadcrumbs/index.tsx +0 -55
- package/dist/components/BreadcrumbsBordered/BreadcrumbsBordered.stories.tsx +0 -52
- package/dist/components/BreadcrumbsBordered/index.tsx +0 -44
- package/dist/components/BreadcrumbsItem/BreadcrumbsItem.stories.tsx +0 -54
- package/dist/components/BreadcrumbsItem/index.tsx +0 -151
- package/dist/components/Button/button.stories.tsx +0 -148
- package/dist/components/Button/index.tsx +0 -91
- package/dist/components/Card/Card.stories.tsx +0 -150
- package/dist/components/Card/index.tsx +0 -162
- package/dist/components/CardWithTopImage/CardWithTopImage.stories.tsx +0 -48
- package/dist/components/CardWithTopImage/index.tsx +0 -40
- package/dist/components/Carousel/Carousel.stories.tsx +0 -369
- package/dist/components/Carousel/index.tsx +0 -267
- package/dist/components/ChevronCard/ChevronCard.stories.tsx +0 -21
- package/dist/components/ChevronCard/index.tsx +0 -39
- package/dist/components/Collapsible/Collapsible.stories.tsx +0 -70
- package/dist/components/Collapsible/index.tsx +0 -124
- package/dist/components/Column/Column.stories.tsx +0 -82
- package/dist/components/Column/index.tsx +0 -114
- package/dist/components/Container/Container.stories.tsx +0 -38
- package/dist/components/Container/index.tsx +0 -30
- package/dist/components/FooterBar/FooterBar.stories.tsx +0 -57
- package/dist/components/FooterBar/index.tsx +0 -44
- package/dist/components/Form/Form.stories.tsx +0 -93
- package/dist/components/Form/index.tsx +0 -58
- package/dist/components/FyreCard/FyreCard.stories.tsx +0 -29
- package/dist/components/FyreCard/index.tsx +0 -46
- package/dist/components/Greeting/Greeting.stories.tsx +0 -42
- package/dist/components/Greeting/index.tsx +0 -46
- package/dist/components/HamburgerIcon/HamburgerIcon.stories.tsx +0 -50
- package/dist/components/HamburgerIcon/index.tsx +0 -65
- package/dist/components/Icon/Icon.stories.tsx +0 -102
- package/dist/components/Icon/index.tsx +0 -112
- package/dist/components/Image/Image.stories.tsx +0 -88
- package/dist/components/Image/index.tsx +0 -113
- package/dist/components/ImageLink/ImageLink.stories.tsx +0 -60
- package/dist/components/ImageLink/index.tsx +0 -62
- package/dist/components/ImageLinkList/ImageLinkList.stories.tsx +0 -34
- package/dist/components/ImageLinkList/index.tsx +0 -33
- package/dist/components/InformationIcon/InformationIcon.stories.tsx +0 -86
- package/dist/components/InformationIcon/index.tsx +0 -84
- package/dist/components/Input/Input.stories.tsx +0 -99
- package/dist/components/Input/index.tsx +0 -126
- package/dist/components/Jumbotron/Jumbotron.stories.tsx +0 -22
- package/dist/components/Jumbotron/index.tsx +0 -25
- package/dist/components/Nav/Nav.stories.tsx +0 -155
- package/dist/components/Nav/index.tsx +0 -180
- package/dist/components/NavItem/NavItem.stories.tsx +0 -89
- package/dist/components/NavItem/index.tsx +0 -65
- package/dist/components/NewsCard/NewsCard.stories.tsx +0 -71
- package/dist/components/NewsCard/index.tsx +0 -48
- package/dist/components/Profile/Profile.stories.tsx +0 -50
- package/dist/components/Profile/index.tsx +0 -87
- package/dist/components/Row/Row.stories.tsx +0 -51
- package/dist/components/Row/index.tsx +0 -24
- package/dist/components/Search/Search.stories.tsx +0 -58
- package/dist/components/Search/index.tsx +0 -58
- package/dist/components/SocialBlock/SocialBlock.stories.tsx +0 -114
- package/dist/components/SocialBlock/index.tsx +0 -161
- package/dist/components/StarRating/StarRating.stories.tsx +0 -23
- package/dist/components/StarRating/index.tsx +0 -71
- package/dist/components/Testimonial/Testimonial.stories.tsx +0 -110
- package/dist/components/Testimonial/index.tsx +0 -50
- package/dist/components/TextAndTitle/TextAndTitle.stories.tsx +0 -65
- package/dist/components/TextAndTitle/index.tsx +0 -257
- package/dist/components/TextArea/TextArea.stories.tsx +0 -67
- package/dist/components/TextArea/index.tsx +0 -97
- package/dist/components/Timeline/Timeline.stories.tsx +0 -100
- package/dist/components/Timeline/index.tsx +0 -315
- package/dist/components/Tubestops/Tubestops.stories.tsx +0 -66
- package/dist/components/Tubestops/index.tsx +0 -77
- package/dist/components/UserIcon/UserIcon.stories.tsx +0 -67
- package/dist/components/UserIcon/index.tsx +0 -42
- package/dist/components/Video/Video.stories.tsx +0 -23
- package/dist/components/Video/index.tsx +0 -49
- package/dist/fonts/Sora/OFL.txt +0 -93
- package/dist/fonts/Sora/README.txt +0 -70
- package/dist/fonts/Sora/Sora-VariableFont_wght.ttf +0 -0
- package/dist/fonts/Sora/static/Sora-Bold.ttf +0 -0
- package/dist/fonts/Sora/static/Sora-ExtraBold.ttf +0 -0
- package/dist/fonts/Sora/static/Sora-ExtraLight.ttf +0 -0
- package/dist/fonts/Sora/static/Sora-Light.ttf +0 -0
- package/dist/fonts/Sora/static/Sora-Medium.ttf +0 -0
- package/dist/fonts/Sora/static/Sora-Regular.ttf +0 -0
- package/dist/fonts/Sora/static/Sora-SemiBold.ttf +0 -0
- package/dist/fonts/Sora/static/Sora-Thin.ttf +0 -0
- package/dist/index.js +0 -272
- package/dist/src/lib/components/Accordion/Accordion.stories.d.ts +0 -6
- package/dist/src/lib/components/Accordion/Accordion.stories.js +0 -80
- package/dist/src/lib/components/Accordion/Accordion.stories.js.map +0 -1
- package/dist/src/lib/components/AlertBar/AlertBar.stories.d.ts +0 -6
- package/dist/src/lib/components/AlertBar/AlertBar.stories.js +0 -91
- package/dist/src/lib/components/AlertBar/AlertBar.stories.js.map +0 -1
- package/dist/src/lib/components/Breadcrumbs/Breadcrumbs.stories.d.ts +0 -6
- package/dist/src/lib/components/Breadcrumbs/Breadcrumbs.stories.js +0 -56
- package/dist/src/lib/components/Breadcrumbs/Breadcrumbs.stories.js.map +0 -1
- package/dist/src/lib/components/BreadcrumbsBordered/BreadcrumbsBordered.stories.d.ts +0 -6
- package/dist/src/lib/components/BreadcrumbsBordered/BreadcrumbsBordered.stories.js +0 -45
- package/dist/src/lib/components/BreadcrumbsBordered/BreadcrumbsBordered.stories.js.map +0 -1
- package/dist/src/lib/components/BreadcrumbsItem/BreadcrumbsItem.stories.d.ts +0 -6
- package/dist/src/lib/components/BreadcrumbsItem/BreadcrumbsItem.stories.js +0 -50
- package/dist/src/lib/components/BreadcrumbsItem/BreadcrumbsItem.stories.js.map +0 -1
- package/dist/src/lib/components/Button/button.stories.d.ts +0 -6
- package/dist/src/lib/components/Button/button.stories.js +0 -132
- package/dist/src/lib/components/Button/button.stories.js.map +0 -1
- package/dist/src/lib/components/Card/Card.stories.d.ts +0 -8
- package/dist/src/lib/components/Card/Card.stories.js +0 -124
- package/dist/src/lib/components/Card/Card.stories.js.map +0 -1
- package/dist/src/lib/components/CardWithTopImage/CardWithTopImage.stories.d.ts +0 -6
- package/dist/src/lib/components/CardWithTopImage/CardWithTopImage.stories.js +0 -40
- package/dist/src/lib/components/CardWithTopImage/CardWithTopImage.stories.js.map +0 -1
- package/dist/src/lib/components/Carousel/Carousel.stories.d.ts +0 -6
- package/dist/src/lib/components/Carousel/Carousel.stories.js +0 -297
- package/dist/src/lib/components/Carousel/Carousel.stories.js.map +0 -1
- package/dist/src/lib/components/ChevronCard/ChevronCard.stories.d.ts +0 -6
- package/dist/src/lib/components/ChevronCard/ChevronCard.stories.js +0 -14
- package/dist/src/lib/components/ChevronCard/ChevronCard.stories.js.map +0 -1
- package/dist/src/lib/components/Collapsible/Collapsible.stories.d.ts +0 -6
- package/dist/src/lib/components/Collapsible/Collapsible.stories.js +0 -66
- package/dist/src/lib/components/Collapsible/Collapsible.stories.js.map +0 -1
- package/dist/src/lib/components/Column/Column.stories.d.ts +0 -6
- package/dist/src/lib/components/Column/Column.stories.js +0 -64
- package/dist/src/lib/components/Column/Column.stories.js.map +0 -1
- package/dist/src/lib/components/Container/Container.stories.d.ts +0 -6
- package/dist/src/lib/components/Container/Container.stories.js +0 -30
- package/dist/src/lib/components/Container/Container.stories.js.map +0 -1
- package/dist/src/lib/components/FooterBar/footerBar.stories.d.ts +0 -6
- package/dist/src/lib/components/FooterBar/footerBar.stories.js +0 -48
- package/dist/src/lib/components/FooterBar/footerBar.stories.js.map +0 -1
- package/dist/src/lib/components/Form/Form.stories.d.ts +0 -6
- package/dist/src/lib/components/Form/Form.stories.js +0 -82
- package/dist/src/lib/components/Form/Form.stories.js.map +0 -1
- package/dist/src/lib/components/FyreCard/FyreCard.stories.d.ts +0 -6
- package/dist/src/lib/components/FyreCard/FyreCard.stories.js +0 -22
- package/dist/src/lib/components/FyreCard/FyreCard.stories.js.map +0 -1
- package/dist/src/lib/components/Greeting/Greeting.stories.d.ts +0 -6
- package/dist/src/lib/components/Greeting/Greeting.stories.js +0 -33
- package/dist/src/lib/components/Greeting/Greeting.stories.js.map +0 -1
- package/dist/src/lib/components/HamburgerIcon/HamburgerIcon.stories.d.ts +0 -6
- package/dist/src/lib/components/HamburgerIcon/HamburgerIcon.stories.js +0 -46
- package/dist/src/lib/components/HamburgerIcon/HamburgerIcon.stories.js.map +0 -1
- package/dist/src/lib/components/Icon/Icon.stories.d.ts +0 -6
- package/dist/src/lib/components/Icon/Icon.stories.js +0 -87
- package/dist/src/lib/components/Icon/Icon.stories.js.map +0 -1
- package/dist/src/lib/components/Image/Image.stories.d.ts +0 -6
- package/dist/src/lib/components/Image/Image.stories.js +0 -73
- package/dist/src/lib/components/Image/Image.stories.js.map +0 -1
- package/dist/src/lib/components/ImageLink/ImageLink.stories.d.ts +0 -9
- package/dist/src/lib/components/ImageLink/ImageLink.stories.js +0 -50
- package/dist/src/lib/components/ImageLink/ImageLink.stories.js.map +0 -1
- package/dist/src/lib/components/ImageLinkList/ImageLinkList.stories.d.ts +0 -6
- package/dist/src/lib/components/ImageLinkList/ImageLinkList.stories.js +0 -27
- package/dist/src/lib/components/ImageLinkList/ImageLinkList.stories.js.map +0 -1
- package/dist/src/lib/components/InformationIcon/InformationIcon.stories.d.ts +0 -6
- package/dist/src/lib/components/InformationIcon/InformationIcon.stories.js +0 -73
- package/dist/src/lib/components/InformationIcon/InformationIcon.stories.js.map +0 -1
- package/dist/src/lib/components/Input/Input.stories.d.ts +0 -6
- package/dist/src/lib/components/Input/Input.stories.js +0 -95
- package/dist/src/lib/components/Input/Input.stories.js.map +0 -1
- package/dist/src/lib/components/Jumbotron/Jumbotron.stories.d.ts +0 -6
- package/dist/src/lib/components/Jumbotron/Jumbotron.stories.js +0 -16
- package/dist/src/lib/components/Jumbotron/Jumbotron.stories.js.map +0 -1
- package/dist/src/lib/components/Nav/Nav.stories.d.ts +0 -6
- package/dist/src/lib/components/Nav/Nav.stories.js +0 -134
- package/dist/src/lib/components/Nav/Nav.stories.js.map +0 -1
- package/dist/src/lib/components/NavItem/NavItem.stories.d.ts +0 -6
- package/dist/src/lib/components/NavItem/NavItem.stories.js +0 -75
- package/dist/src/lib/components/NavItem/NavItem.stories.js.map +0 -1
- package/dist/src/lib/components/NewsCard/NewsCard.stories.d.ts +0 -6
- package/dist/src/lib/components/NewsCard/NewsCard.stories.js +0 -60
- package/dist/src/lib/components/NewsCard/NewsCard.stories.js.map +0 -1
- package/dist/src/lib/components/Profile/Profile.stories.d.ts +0 -6
- package/dist/src/lib/components/Profile/Profile.stories.js +0 -41
- package/dist/src/lib/components/Profile/Profile.stories.js.map +0 -1
- package/dist/src/lib/components/Row/Row.stories.d.ts +0 -6
- package/dist/src/lib/components/Row/Row.stories.js +0 -37
- package/dist/src/lib/components/Row/Row.stories.js.map +0 -1
- package/dist/src/lib/components/Search/Search.stories.d.ts +0 -6
- package/dist/src/lib/components/Search/Search.stories.js +0 -48
- package/dist/src/lib/components/Search/Search.stories.js.map +0 -1
- package/dist/src/lib/components/SocialBlock/SocialBlock.stories.d.ts +0 -6
- package/dist/src/lib/components/SocialBlock/SocialBlock.stories.js +0 -58
- package/dist/src/lib/components/SocialBlock/SocialBlock.stories.js.map +0 -1
- package/dist/src/lib/components/StarRating/StarRating.stories.d.ts +0 -6
- package/dist/src/lib/components/StarRating/StarRating.stories.js +0 -17
- package/dist/src/lib/components/StarRating/StarRating.stories.js.map +0 -1
- package/dist/src/lib/components/Testimonial/Testimonial.stories.d.ts +0 -6
- package/dist/src/lib/components/Testimonial/Testimonial.stories.js +0 -95
- package/dist/src/lib/components/Testimonial/Testimonial.stories.js.map +0 -1
- package/dist/src/lib/components/TextAndTitle/TextAndTitle.stories.d.ts +0 -6
- package/dist/src/lib/components/TextAndTitle/TextAndTitle.stories.js +0 -63
- package/dist/src/lib/components/TextAndTitle/TextAndTitle.stories.js.map +0 -1
- package/dist/src/lib/components/TextArea/TextArea.stories.d.ts +0 -6
- package/dist/src/lib/components/TextArea/TextArea.stories.js +0 -63
- package/dist/src/lib/components/TextArea/TextArea.stories.js.map +0 -1
- package/dist/src/lib/components/Timeline/Timeline.stories.d.ts +0 -6
- package/dist/src/lib/components/Timeline/Timeline.stories.js +0 -87
- package/dist/src/lib/components/Timeline/Timeline.stories.js.map +0 -1
- package/dist/src/lib/components/Tubestops/Tubestops.stories.d.ts +0 -6
- package/dist/src/lib/components/Tubestops/Tubestops.stories.js +0 -62
- package/dist/src/lib/components/Tubestops/Tubestops.stories.js.map +0 -1
- package/dist/src/lib/components/UserIcon/UserIcon.stories.d.ts +0 -6
- package/dist/src/lib/components/UserIcon/UserIcon.stories.js +0 -63
- package/dist/src/lib/components/UserIcon/UserIcon.stories.js.map +0 -1
- package/dist/src/lib/components/Video/Video.stories.d.ts +0 -6
- package/dist/src/lib/components/Video/Video.stories.js +0 -17
- package/dist/src/lib/components/Video/Video.stories.js.map +0 -1
- package/dist/src/lib/typography/Fonts.stories.d.ts +0 -6
- package/dist/src/lib/typography/Fonts.stories.js +0 -12
- package/dist/src/lib/typography/Fonts.stories.js.map +0 -1
- package/dist/styles/base.css +0 -73
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import Profile from './index'
|
|
3
|
-
import userImage from '@assets/images/user.jpeg'
|
|
4
|
-
import { idAndClassName } from '@utils/controls'
|
|
5
|
-
import { ComponentStory, ComponentMeta } from '@storybook/react'
|
|
6
|
-
|
|
7
|
-
const componentMeta: ComponentMeta<typeof Profile> = {
|
|
8
|
-
title: 'Trepur Components/Other/Organisms/Profile',
|
|
9
|
-
component: Profile,
|
|
10
|
-
parameters: {},
|
|
11
|
-
argTypes: {
|
|
12
|
-
...idAndClassName,
|
|
13
|
-
imageProps: {
|
|
14
|
-
type: { name: 'other', value: 'object' },
|
|
15
|
-
description: 'The props to pass to the image to display on the component',
|
|
16
|
-
table: {
|
|
17
|
-
type: {
|
|
18
|
-
summary: 'object'
|
|
19
|
-
},
|
|
20
|
-
defaultValue: { summary: 'undefined' }
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
alignment: {
|
|
24
|
-
description: '',
|
|
25
|
-
control: 'select',
|
|
26
|
-
options: ['left', 'center', 'right'],
|
|
27
|
-
table: {
|
|
28
|
-
category: ''
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
profileLinks: {
|
|
32
|
-
description: '',
|
|
33
|
-
control: 'text',
|
|
34
|
-
table: {
|
|
35
|
-
category: ''
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
args: {
|
|
40
|
-
imageProps: {
|
|
41
|
-
image: userImage
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
const Template: ComponentStory<typeof Profile> = (args) => <Profile {...args} />
|
|
47
|
-
|
|
48
|
-
export const _Profile = Template.bind({})
|
|
49
|
-
|
|
50
|
-
export default componentMeta
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react'
|
|
2
|
-
import Image, { Props as imageProps } from '@components/Image'
|
|
3
|
-
import classNames from 'classnames'
|
|
4
|
-
|
|
5
|
-
export interface Props {
|
|
6
|
-
id?: string
|
|
7
|
-
className?: string
|
|
8
|
-
profileLinks?: Array<{ name: string, link: string }>
|
|
9
|
-
alignment?: 'left' | 'right'
|
|
10
|
-
imageHeight?: number
|
|
11
|
-
imageWidth?: number
|
|
12
|
-
rounded?: boolean
|
|
13
|
-
bordered?: boolean
|
|
14
|
-
imageProps?: imageProps
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const Profile = ({
|
|
18
|
-
id,
|
|
19
|
-
className,
|
|
20
|
-
profileLinks,
|
|
21
|
-
alignment,
|
|
22
|
-
imageHeight = 0,
|
|
23
|
-
imageWidth = 0,
|
|
24
|
-
rounded,
|
|
25
|
-
bordered,
|
|
26
|
-
imageProps
|
|
27
|
-
}: Props): JSX.Element => {
|
|
28
|
-
const [profileState, setProfileState] = useState(false)
|
|
29
|
-
|
|
30
|
-
const profileAlignment = classNames({
|
|
31
|
-
'float-right': alignment === 'right',
|
|
32
|
-
'float-left': alignment === 'left'
|
|
33
|
-
})
|
|
34
|
-
|
|
35
|
-
const dropdownAlignement = classNames({
|
|
36
|
-
'mt-16 -mr-16': alignment === 'right',
|
|
37
|
-
'mt-16 -ml-16': alignment === 'left'
|
|
38
|
-
})
|
|
39
|
-
|
|
40
|
-
const dropdownTextAlignement = classNames({
|
|
41
|
-
'text-center': alignment !== 'right' && alignment !== 'left'
|
|
42
|
-
})
|
|
43
|
-
|
|
44
|
-
const classList = classNames({
|
|
45
|
-
'rounded-full': rounded === true,
|
|
46
|
-
border: bordered === true
|
|
47
|
-
}, className, `h-${imageHeight} w-${imageWidth} object-cover`)
|
|
48
|
-
|
|
49
|
-
return (
|
|
50
|
-
<>
|
|
51
|
-
<div id={id} className={`text-center ${classList}`}>
|
|
52
|
-
<div className={`hidden sm:inline-flex inset-y-0 ${profileAlignment}`}>
|
|
53
|
-
<button
|
|
54
|
-
onClick={() => setProfileState(!profileState)}
|
|
55
|
-
type='button'
|
|
56
|
-
className='flex rounded-full'
|
|
57
|
-
>
|
|
58
|
-
<Image {...imageProps} />
|
|
59
|
-
</button>
|
|
60
|
-
</div>
|
|
61
|
-
</div>
|
|
62
|
-
{profileState &&
|
|
63
|
-
<div className={dropdownTextAlignement}>
|
|
64
|
-
<div className={`w-48 sm:inline-block shadow-lg
|
|
65
|
-
z-10 ${profileAlignment} ${dropdownAlignement}`}
|
|
66
|
-
>
|
|
67
|
-
{profileLinks?.map((link, i) => {
|
|
68
|
-
return (
|
|
69
|
-
<a
|
|
70
|
-
key={`profile_link_${i + 1}`}
|
|
71
|
-
href={link.link}
|
|
72
|
-
className='border-b font-bold block px-4 py-2 text-sm'
|
|
73
|
-
role='menuitem'
|
|
74
|
-
// tabindex="-1"
|
|
75
|
-
id={`user-menu-item-${i + 1}`}
|
|
76
|
-
>
|
|
77
|
-
{link.name}
|
|
78
|
-
</a>
|
|
79
|
-
)
|
|
80
|
-
})}
|
|
81
|
-
</div>
|
|
82
|
-
</div>}
|
|
83
|
-
</>
|
|
84
|
-
)
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
export default Profile
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import Row from './index'
|
|
3
|
-
import CardWithTopImage from '@components/CardWithTopImage'
|
|
4
|
-
import logo from '@assets/images/primary-logo.png'
|
|
5
|
-
import { ComponentStory, ComponentMeta } from '@storybook/react'
|
|
6
|
-
import { idAndClassName } from '@utils/controls'
|
|
7
|
-
|
|
8
|
-
const cardChild = (
|
|
9
|
-
<CardWithTopImage
|
|
10
|
-
imageProps={{
|
|
11
|
-
image: logo,
|
|
12
|
-
rounded: true,
|
|
13
|
-
height: 4,
|
|
14
|
-
width: 4,
|
|
15
|
-
roundedFull: true
|
|
16
|
-
}}
|
|
17
|
-
className='w-1/3'
|
|
18
|
-
>
|
|
19
|
-
<p>This is some text</p>
|
|
20
|
-
<p>This is some more text</p>
|
|
21
|
-
<p>This is a bit more text</p>
|
|
22
|
-
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorem odit ad sed, quam recusandae voluptatem provident eveniet beatae omnis vero minus unde facilis. Quia commodi quas odit iusto ut enim!</p>
|
|
23
|
-
</CardWithTopImage>
|
|
24
|
-
)
|
|
25
|
-
|
|
26
|
-
const componentMeta: ComponentMeta<typeof Row> = {
|
|
27
|
-
title: 'Trepur Components/Rupert Bennett/Atoms/Row',
|
|
28
|
-
component: Row,
|
|
29
|
-
argTypes: {
|
|
30
|
-
...idAndClassName,
|
|
31
|
-
children: {
|
|
32
|
-
type: { name: 'other', value: 'string | React.ReactNode' },
|
|
33
|
-
description: 'The child elements to show in the component',
|
|
34
|
-
table: {
|
|
35
|
-
type: {
|
|
36
|
-
summary: 'Array'
|
|
37
|
-
},
|
|
38
|
-
defaultValue: { summary: 'undefined' }
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
args: {
|
|
43
|
-
children: cardChild
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
const Template: ComponentStory<typeof Row> = (args) => <Row {...args} />
|
|
48
|
-
|
|
49
|
-
export const _Row = Template.bind({})
|
|
50
|
-
|
|
51
|
-
export default componentMeta
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import classNames from 'classnames'
|
|
3
|
-
|
|
4
|
-
export interface Props {
|
|
5
|
-
id?: string
|
|
6
|
-
className?: string
|
|
7
|
-
children: any
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
const Row = ({
|
|
11
|
-
id,
|
|
12
|
-
className,
|
|
13
|
-
children
|
|
14
|
-
}: Props): JSX.Element => {
|
|
15
|
-
const classList = classNames(className, 'flex flex-wrap')
|
|
16
|
-
|
|
17
|
-
return (
|
|
18
|
-
<div id={id} className={classList}>
|
|
19
|
-
{children}
|
|
20
|
-
</div>
|
|
21
|
-
)
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export default Row
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { idAndClassName } from '@utils/controls'
|
|
3
|
-
import Search from './index'
|
|
4
|
-
import { ComponentStory, ComponentMeta } from '@storybook/react'
|
|
5
|
-
|
|
6
|
-
const componentMeta: ComponentMeta<typeof Search> = {
|
|
7
|
-
title: 'Trepur Components/Other/Organisms/Search',
|
|
8
|
-
component: Search,
|
|
9
|
-
parameters: {},
|
|
10
|
-
argTypes: {
|
|
11
|
-
...idAndClassName,
|
|
12
|
-
leftIconProps: {
|
|
13
|
-
description: 'An optional param to display an icon to the left of the search bar',
|
|
14
|
-
control: 'text',
|
|
15
|
-
table: {
|
|
16
|
-
category: ''
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
rightIconProps: {
|
|
20
|
-
description: 'An optional param to display an icon to the right of the search bar',
|
|
21
|
-
control: 'text',
|
|
22
|
-
table: {
|
|
23
|
-
category: ''
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
placeholder: {
|
|
27
|
-
description: 'An optional param to display a placeholder inside the search box',
|
|
28
|
-
control: 'text',
|
|
29
|
-
table: {
|
|
30
|
-
category: ''
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
text: {
|
|
34
|
-
description: 'An optional param to display a label on the left of the search bar',
|
|
35
|
-
control: 'text',
|
|
36
|
-
table: {
|
|
37
|
-
category: ''
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
args: {
|
|
42
|
-
placeholder: 'search...',
|
|
43
|
-
leftIconProps: {
|
|
44
|
-
type: 'heart',
|
|
45
|
-
className: 'absolute py-4 left-3 flex items-center'
|
|
46
|
-
},
|
|
47
|
-
rightIconProps: {
|
|
48
|
-
type: 'heart',
|
|
49
|
-
className: 'absolute py-4 right-3 flex items-center'
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
const Template: ComponentStory<typeof Search> = (args) => <Search {...args} />
|
|
55
|
-
|
|
56
|
-
export const _Search = Template.bind({})
|
|
57
|
-
|
|
58
|
-
export default componentMeta
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import React, { ChangeEventHandler } from 'react'
|
|
2
|
-
import Icon, { Props as iconProps } from '@components/Icon'
|
|
3
|
-
import classNames from 'classnames'
|
|
4
|
-
|
|
5
|
-
export interface Props {
|
|
6
|
-
id?: string
|
|
7
|
-
className?: string
|
|
8
|
-
onChange?: (val: string | number) => void
|
|
9
|
-
placeholder?: string
|
|
10
|
-
text?: string
|
|
11
|
-
leftIconProps?: iconProps
|
|
12
|
-
rightIconProps?: iconProps
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const Search = ({
|
|
16
|
-
id,
|
|
17
|
-
className,
|
|
18
|
-
onChange,
|
|
19
|
-
placeholder,
|
|
20
|
-
text,
|
|
21
|
-
leftIconProps,
|
|
22
|
-
rightIconProps
|
|
23
|
-
}: Props): JSX.Element => {
|
|
24
|
-
const classList = classNames(className, 'flex')
|
|
25
|
-
|
|
26
|
-
const inputClasses = classNames({
|
|
27
|
-
'pl-9': leftIconProps !== undefined,
|
|
28
|
-
'pl-2': leftIconProps === undefined
|
|
29
|
-
}, 'w-full border-2 rounded-md py-2 pr-9')
|
|
30
|
-
|
|
31
|
-
const onChangeFunc: ChangeEventHandler<HTMLInputElement> | undefined = (onChange != null) ? (e: any) => onChange(e.target.value) : undefined
|
|
32
|
-
|
|
33
|
-
return (
|
|
34
|
-
<div id={id} className={classList}>
|
|
35
|
-
<div>
|
|
36
|
-
{text !== undefined &&
|
|
37
|
-
<h2 className='font-base-lg py-2 pr-4'>{text}</h2>}
|
|
38
|
-
</div>
|
|
39
|
-
<div>
|
|
40
|
-
<div className='relative w-full flex'>
|
|
41
|
-
{(leftIconProps != null) &&
|
|
42
|
-
<Icon {...leftIconProps} />}
|
|
43
|
-
<input
|
|
44
|
-
className={inputClasses}
|
|
45
|
-
onChange={onChangeFunc}
|
|
46
|
-
placeholder={placeholder}
|
|
47
|
-
type='text'
|
|
48
|
-
name='search'
|
|
49
|
-
/>
|
|
50
|
-
{(rightIconProps != null) &&
|
|
51
|
-
<Icon {...rightIconProps} />}
|
|
52
|
-
</div>
|
|
53
|
-
</div>
|
|
54
|
-
</div>
|
|
55
|
-
)
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export default Search
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import SocialBlock from './index'
|
|
3
|
-
import { action } from '@storybook/addon-actions'
|
|
4
|
-
import Icon from '@components/Icon'
|
|
5
|
-
import Button from '@components/Button'
|
|
6
|
-
import { ComponentStory, ComponentMeta } from '@storybook/react'
|
|
7
|
-
|
|
8
|
-
const socialButtons = [
|
|
9
|
-
<Button
|
|
10
|
-
key='btn_1'
|
|
11
|
-
className='mx-2 w-16 py-4 border border-1'
|
|
12
|
-
href='https://www.facebook.com/rupert.bennett'
|
|
13
|
-
type='social'
|
|
14
|
-
>
|
|
15
|
-
<Icon
|
|
16
|
-
type='facebook-f'
|
|
17
|
-
brand
|
|
18
|
-
size={2}
|
|
19
|
-
className='mx-auto'
|
|
20
|
-
colour='white'
|
|
21
|
-
bgColour='primary'
|
|
22
|
-
/>
|
|
23
|
-
</Button>,
|
|
24
|
-
<Button
|
|
25
|
-
key='btn_2'
|
|
26
|
-
className='mx-2 w-16 py-4 border border-1'
|
|
27
|
-
href='https://www.linkedin.com/in/rupert-bennett'
|
|
28
|
-
type='social'
|
|
29
|
-
>
|
|
30
|
-
<Icon
|
|
31
|
-
brand
|
|
32
|
-
type='linkedin-in'
|
|
33
|
-
size={2}
|
|
34
|
-
className='mx-auto'
|
|
35
|
-
colour='white'
|
|
36
|
-
bgColour='primary'
|
|
37
|
-
/>
|
|
38
|
-
</Button>,
|
|
39
|
-
<Button
|
|
40
|
-
key='btn_3'
|
|
41
|
-
className='mx-2 w-16 py-4 border border-1'
|
|
42
|
-
href='https://github.com/irupertbennett'
|
|
43
|
-
type='social'
|
|
44
|
-
>
|
|
45
|
-
<Icon
|
|
46
|
-
brand
|
|
47
|
-
type='github'
|
|
48
|
-
size={2}
|
|
49
|
-
className='mx-auto'
|
|
50
|
-
colour='white'
|
|
51
|
-
bgColour='primary'
|
|
52
|
-
/>
|
|
53
|
-
</Button>,
|
|
54
|
-
<Button
|
|
55
|
-
key='btn_4'
|
|
56
|
-
className='mx-2 w-16 py-4 border border-1'
|
|
57
|
-
href='mailto:irupertbennett@gmail.com?subject=rupertbennett.com-&body=Referred from rupertbennett.com'
|
|
58
|
-
type='social'
|
|
59
|
-
>
|
|
60
|
-
<Icon
|
|
61
|
-
type='envelope'
|
|
62
|
-
size={2}
|
|
63
|
-
className='mx-auto'
|
|
64
|
-
colour='white'
|
|
65
|
-
bgColour='primary'
|
|
66
|
-
/>
|
|
67
|
-
</Button>
|
|
68
|
-
]
|
|
69
|
-
|
|
70
|
-
const componentMeta: ComponentMeta<typeof SocialBlock> = {
|
|
71
|
-
title: 'Trepur Components/Rupert Bennett/Organisms/Social Block',
|
|
72
|
-
component: SocialBlock,
|
|
73
|
-
parameters: {},
|
|
74
|
-
argTypes: {
|
|
75
|
-
withLiveUpdates: {
|
|
76
|
-
description: '',
|
|
77
|
-
control: 'boolean',
|
|
78
|
-
table: { category: '' }
|
|
79
|
-
},
|
|
80
|
-
onSave: {
|
|
81
|
-
type: { name: 'function', required: false },
|
|
82
|
-
description: 'Fires a function when you click save',
|
|
83
|
-
action: 'onClick',
|
|
84
|
-
table: {
|
|
85
|
-
type: { summary: 'function' },
|
|
86
|
-
defaultValue: { summary: 'undefined' }
|
|
87
|
-
}
|
|
88
|
-
},
|
|
89
|
-
theme: {
|
|
90
|
-
type: { name: 'string', required: false },
|
|
91
|
-
options: ['dark', 'light'],
|
|
92
|
-
description: 'The variant of button to render',
|
|
93
|
-
table: { type: { summary: 'dark' }, defaultValue: { summary: 'dark' } },
|
|
94
|
-
defaultValue: 'dark',
|
|
95
|
-
control: { type: 'radio' }
|
|
96
|
-
}
|
|
97
|
-
},
|
|
98
|
-
args: {
|
|
99
|
-
title: 'Why not connect with me on LinkedIn or Facebook?',
|
|
100
|
-
text: 'Or send me a E-Mail to get in touch',
|
|
101
|
-
editTitleClasses: 'text-md sm:text-lg ',
|
|
102
|
-
editTextClasses: '',
|
|
103
|
-
editInputClasses: 'mt-4 border border-black text-black bg-white',
|
|
104
|
-
onSave: action('button-save'),
|
|
105
|
-
withLiveUpdates: true,
|
|
106
|
-
socialButtons
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
const Template: ComponentStory<typeof SocialBlock> = (args) => <SocialBlock {...args} />
|
|
111
|
-
|
|
112
|
-
export const _SocialBlock = Template.bind({})
|
|
113
|
-
|
|
114
|
-
export default componentMeta
|
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react'
|
|
2
|
-
import Input from '@components/Input'
|
|
3
|
-
import Button, { Props as buttonProps } from '@components/Button'
|
|
4
|
-
import classNames from 'classnames'
|
|
5
|
-
|
|
6
|
-
export interface Props {
|
|
7
|
-
id?: string
|
|
8
|
-
className?: string
|
|
9
|
-
title?: string
|
|
10
|
-
text?: string
|
|
11
|
-
withLiveUpdates?: boolean
|
|
12
|
-
onSave?: (arr: any[], id: string | undefined) => void
|
|
13
|
-
saveButtonProps?: buttonProps
|
|
14
|
-
cancelButtonProps?: buttonProps
|
|
15
|
-
editTitleClasses?: string
|
|
16
|
-
editTextClasses?: string
|
|
17
|
-
editInputClasses?: string
|
|
18
|
-
buttonWrapperClasses?: string
|
|
19
|
-
textWrapperClasses?: string
|
|
20
|
-
socialButtons?: buttonProps[]
|
|
21
|
-
theme: 'light' | 'dark'
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const SocialBlock = ({
|
|
25
|
-
id,
|
|
26
|
-
className,
|
|
27
|
-
title,
|
|
28
|
-
text,
|
|
29
|
-
withLiveUpdates,
|
|
30
|
-
onSave,
|
|
31
|
-
saveButtonProps,
|
|
32
|
-
cancelButtonProps,
|
|
33
|
-
editTitleClasses,
|
|
34
|
-
editTextClasses,
|
|
35
|
-
editInputClasses,
|
|
36
|
-
buttonWrapperClasses,
|
|
37
|
-
textWrapperClasses,
|
|
38
|
-
socialButtons,
|
|
39
|
-
theme = 'light'
|
|
40
|
-
}: Props): JSX.Element => {
|
|
41
|
-
const colours = theme === 'dark' ? 'placeholder-white bg-primary text-white' : 'placeholder-primary bg-white text-primary'
|
|
42
|
-
const defaultComponentData = {
|
|
43
|
-
title: {
|
|
44
|
-
text: title
|
|
45
|
-
},
|
|
46
|
-
text: {
|
|
47
|
-
text
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const [isInEditingMode, setIsInEditingMode] = useState(false)
|
|
52
|
-
const [isHovering, setIsHovering] = useState(false)
|
|
53
|
-
const [componentData, setComponentData] = useState(defaultComponentData)
|
|
54
|
-
const hoverClasses = 'border-dashed border'
|
|
55
|
-
|
|
56
|
-
const classList = classNames(className, colours)
|
|
57
|
-
const buttnoWrapperClasslist = classNames(buttonWrapperClasses, 'py-4')
|
|
58
|
-
|
|
59
|
-
const hoverClassList = classNames({
|
|
60
|
-
[hoverClasses]: withLiveUpdates !== undefined && !isInEditingMode && isHovering
|
|
61
|
-
}, textWrapperClasses)
|
|
62
|
-
|
|
63
|
-
const toggleEditState = (): void => {
|
|
64
|
-
withLiveUpdates === true && setIsInEditingMode(!isInEditingMode)
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
const handleButtonSave = (): void => {
|
|
68
|
-
const arr = []
|
|
69
|
-
arr.push({ key: 'title', value: componentData.title.text })
|
|
70
|
-
arr.push({ key: 'text', value: componentData.text.text })
|
|
71
|
-
toggleEditState()
|
|
72
|
-
onSave?.(arr, id)
|
|
73
|
-
setIsHovering(false)
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
const handleButtonCancel = (): void => {
|
|
77
|
-
toggleEditState()
|
|
78
|
-
setIsHovering(false)
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
const handleChange = (e: any): void => {
|
|
82
|
-
let id = e.target.id
|
|
83
|
-
id = id.split('-')[id.split('-').length - 1]
|
|
84
|
-
setComponentData({
|
|
85
|
-
...componentData,
|
|
86
|
-
[id]: {
|
|
87
|
-
text: e.target.value
|
|
88
|
-
}
|
|
89
|
-
})
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
const toggleHoverState = (): void => {
|
|
93
|
-
withLiveUpdates === true && setIsHovering(!isHovering)
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
return (
|
|
97
|
-
<div
|
|
98
|
-
id={id}
|
|
99
|
-
className={classList}
|
|
100
|
-
>
|
|
101
|
-
{withLiveUpdates === true && isInEditingMode
|
|
102
|
-
? (
|
|
103
|
-
<div className={colours}>
|
|
104
|
-
<Input
|
|
105
|
-
id='title'
|
|
106
|
-
className={editTitleClasses}
|
|
107
|
-
inputClasses={editInputClasses}
|
|
108
|
-
autoFocus
|
|
109
|
-
value={componentData.title.text}
|
|
110
|
-
onChange={(e: any) => handleChange(e)}
|
|
111
|
-
type='text'
|
|
112
|
-
theme={theme}
|
|
113
|
-
/>
|
|
114
|
-
<Input
|
|
115
|
-
id='text'
|
|
116
|
-
className={editTextClasses}
|
|
117
|
-
inputClasses={editInputClasses}
|
|
118
|
-
value={componentData.text.text}
|
|
119
|
-
onChange={(e: any) => handleChange(e)}
|
|
120
|
-
type='text'
|
|
121
|
-
theme={theme}
|
|
122
|
-
/>
|
|
123
|
-
<Button
|
|
124
|
-
className='mt-4'
|
|
125
|
-
onClick={handleButtonSave}
|
|
126
|
-
>
|
|
127
|
-
Save
|
|
128
|
-
</Button>
|
|
129
|
-
<Button
|
|
130
|
-
className='mt-4 ml-4'
|
|
131
|
-
onClick={handleButtonCancel}
|
|
132
|
-
>
|
|
133
|
-
Cancel
|
|
134
|
-
</Button>
|
|
135
|
-
</div>
|
|
136
|
-
)
|
|
137
|
-
: (
|
|
138
|
-
<>
|
|
139
|
-
<div
|
|
140
|
-
onMouseOver={() => toggleHoverState()}
|
|
141
|
-
onMouseOut={() => toggleHoverState()}
|
|
142
|
-
onClick={toggleEditState}
|
|
143
|
-
className={hoverClassList}
|
|
144
|
-
>
|
|
145
|
-
<h2 className='text-md sm:text-lg'>{componentData.title.text}</h2>
|
|
146
|
-
<p className='pt-4'>{componentData.text.text}</p>
|
|
147
|
-
</div>
|
|
148
|
-
<div className={buttnoWrapperClasslist}>
|
|
149
|
-
<div className='flex flex-wrap w-full justify-center'>
|
|
150
|
-
{socialButtons?.map((button, i: number) => {
|
|
151
|
-
return <div key={`social_btn_${i + 1}`}>{button}</div>
|
|
152
|
-
})}
|
|
153
|
-
</div>
|
|
154
|
-
</div>
|
|
155
|
-
</>
|
|
156
|
-
)}
|
|
157
|
-
</div>
|
|
158
|
-
)
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
export default SocialBlock
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import StarRating from './index'
|
|
3
|
-
import { idAndClassName } from '@utils/controls'
|
|
4
|
-
import { ComponentStory, ComponentMeta } from '@storybook/react'
|
|
5
|
-
|
|
6
|
-
const componentMeta: ComponentMeta<typeof StarRating> = {
|
|
7
|
-
title: 'Trepur Components/Other/Atoms/Star Rating',
|
|
8
|
-
component: StarRating,
|
|
9
|
-
parameters: {},
|
|
10
|
-
argTypes: {
|
|
11
|
-
...idAndClassName
|
|
12
|
-
},
|
|
13
|
-
args: {
|
|
14
|
-
stars: 3,
|
|
15
|
-
size: 2
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const Template: ComponentStory<typeof StarRating> = (args) => <StarRating {...args} />
|
|
20
|
-
|
|
21
|
-
export const _StarRating = Template.bind({})
|
|
22
|
-
|
|
23
|
-
export default componentMeta
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import Icon from '@components/Icon'
|
|
3
|
-
import classNames from 'classnames'
|
|
4
|
-
|
|
5
|
-
export interface Props {
|
|
6
|
-
id: string
|
|
7
|
-
className: string
|
|
8
|
-
stars: number
|
|
9
|
-
size: number
|
|
10
|
-
}
|
|
11
|
-
const StarRating = ({
|
|
12
|
-
id,
|
|
13
|
-
className,
|
|
14
|
-
stars = 1,
|
|
15
|
-
size = 1
|
|
16
|
-
}: Props): JSX.Element => {
|
|
17
|
-
const classList = classNames({
|
|
18
|
-
}, `${className} flex`)
|
|
19
|
-
|
|
20
|
-
const getStars = (): JSX.Element[] => {
|
|
21
|
-
const starsArr = []
|
|
22
|
-
for (let i = 0; i < stars; i++) {
|
|
23
|
-
starsArr.push(
|
|
24
|
-
<Icon
|
|
25
|
-
key={`checked_star_${i + 0}`}
|
|
26
|
-
id={`checked-${i}`}
|
|
27
|
-
className='checked'
|
|
28
|
-
type='star'
|
|
29
|
-
size={size}
|
|
30
|
-
colour='gold'
|
|
31
|
-
bgColour='white'
|
|
32
|
-
/>
|
|
33
|
-
)
|
|
34
|
-
}
|
|
35
|
-
return starsArr
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
const getStarsChecked = (): JSX.Element[] => {
|
|
39
|
-
const starsArr = []
|
|
40
|
-
for (let i = 0; i < 5 - stars; i++) {
|
|
41
|
-
starsArr.push(
|
|
42
|
-
<Icon
|
|
43
|
-
key={`unchecked_star_${i + 0}`}
|
|
44
|
-
id={`unchecked-${i}`}
|
|
45
|
-
className='unchecked opacity-30 gold'
|
|
46
|
-
type='star'
|
|
47
|
-
size={size}
|
|
48
|
-
colour='gold'
|
|
49
|
-
bgColour='white'
|
|
50
|
-
/>
|
|
51
|
-
)
|
|
52
|
-
}
|
|
53
|
-
return starsArr
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
const getAllStars = (): JSX.Element[] => {
|
|
57
|
-
const starArray = [...getStars(), ...getStarsChecked()]
|
|
58
|
-
return starArray
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
return (
|
|
62
|
-
<div
|
|
63
|
-
id={id}
|
|
64
|
-
className={classList}
|
|
65
|
-
>
|
|
66
|
-
{getAllStars()}
|
|
67
|
-
</div>
|
|
68
|
-
)
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
export default StarRating
|