wix-style-react
Version:
111 lines (100 loc) • 3.23 kB
JavaScript
export const _mode = `
() => {
const [value, setValue] = React.useState(3)
return (
<StorybookComponents.Stack>
<StarsRatingBar
value={value}
onChange={setValue}
/>
<StarsRatingBar value={3} readOnly />
</StorybookComponents.Stack>
);
};`;
export const _size = `
<StorybookComponents.Stack>
<StarsRatingBar size="large" />
<StorybookComponents.Stack flexDirection="column">
<StarsRatingBar size="large" readOnly />
<StarsRatingBar size="medium" readOnly />
<StarsRatingBar size="small" readOnly />
<StarsRatingBar size="tiny" readOnly />
</StorybookComponents.Stack>
</StorybookComponents.Stack>;`;
export const _captions = `
() => {
const descriptionValues = ['Very bad', 'Bad', 'Ok', 'Good', 'Very good'];
return (
<StorybookComponents.Stack flexDirection="column">
<StarsRatingBar descriptionValues={descriptionValues} value={1} />
<StarsRatingBar descriptionValues={descriptionValues} value={2} />
<StarsRatingBar descriptionValues={descriptionValues} value={3} />
<StarsRatingBar descriptionValues={descriptionValues} value={4} />
<StarsRatingBar descriptionValues={descriptionValues} value={5} />
</StorybookComponents.Stack>
);
};`;
export const _collectingFeedback = `
() => {
const [value, setValue] = React.useState(3);
const descriptionValues = ['Very bad', 'Bad', 'Ok', 'Good', 'Very good'];
const renderRatingBar = (
<FormField label="How would you rate this app?">
<StarsRatingBar
descriptionValues={descriptionValues}
value={value}
onChange={setValue}
/>
</FormField>
);
const renderReviewTitle = (
<FormField label="Review Title">
<Input placeholder="What's most important for people to know?" />
</FormField>
);
const renderReview = (
<FormField label="Review (optional)">
<InputArea
minHeight="90px"
placeholder="Describe your experience. What did you like or dislike about this app?"
/>
</FormField>
);
return (
<CustomModalLayout
primaryButtonText="Post Review"
secondaryButtonText="Cancel"
onCloseButtonClick={() => {}}
title="Share Your Experience!"
>
<Layout gap="24px">
<Cell span={12}>{renderRatingBar}</Cell>
<Cell span={12}>{renderReviewTitle}</Cell>
<Cell span={12}>{renderReview}</Cell>
</Layout>
</CustomModalLayout>
);
};`;
export const _displayingFeedback = `
<Card>
<Card.Content>
<Box gap="18px">
<Avatar color="A2" name={'John Doe'} />
<Box direction="vertical" gap="6px">
<Box>
<Text size="small">Pauline0187 </Text>
<Text size="small" secondary>
/ Apr 07, 2021
</Text>
</Box>
<StarsRatingBar value={4} readOnly size="small" />
<Text weight="bold">Amazing App, Amazing Support team</Text>
<Text weight="thin">
I love this app! I have a Membership only website with over 100 pages.
Site Search let's a user type in any word they want to find on the
site and it serv... <a>Read more</a>
</Text>
</Box>
</Box>
</Card.Content>
</Card>;`;