import { socialWebsites } from '@config/social-media'; import GithubIcon from '@assets/images/social-media/github.svg'; import GitlabIcon from '@assets/images/social-media/gitlab.svg'; import LinkedInIcon from '@assets/images/social-media/linkedin.svg'; import TwitterIcon from '@assets/images/social-media/twitter.svg'; import styles from './SocialMedia.module.scss'; import { ExpandableWidget } from '@components/WidgetParts'; const SocialMedia = ({ title, github = false, gitlab = false, linkedin = false, twitter = false, }: { title: string; github?: boolean; gitlab?: boolean; linkedin?: boolean; twitter?: boolean; }) => { const getIcon = (id: string) => { switch (id) { case 'github': return ; case 'gitlab': return ; case 'linkedin': return ; case 'twitter': return ; default: break; } }; const shouldDisplayLink = (id: string) => { switch (id) { case 'github': return github; case 'gitlab': return gitlab; case 'linkedin': return linkedin; case 'twitter': return twitter; default: break; } }; const items = socialWebsites.map((website) => { return shouldDisplayLink(website.id) ? (
  • {getIcon(website.id)} {website.name}
  • ) : ( '' ); }); return (
      {items}
    ); }; export default SocialMedia; www.armandphilippot.com/commit/src/components/molecules/forms/prism-theme-toggle.stories.tsx?h=v1.0.0&id=4ac14dec8288183d930684fa07463994f561eecc'>commitdiffstats
    blob: ef4ed6ea07016d1e2149b34ab65ac28638481169 (plain)
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    
    import { ComponentMeta, ComponentStory } from '@storybook/react';
    import PrismThemeToggle from './prism-theme-toggle';
    
    /**
     * PrismThemeToggle - Storybook Meta
     */
    export default {
      title: 'Molecules/Forms/Toggle',
      component: PrismThemeToggle,
      argTypes: {
        labelClassName: {
          control: {
            type: 'text',
          },
          description: 'Set additional classnames to the label wrapper.',
          table: {
            category: 'Styles',
          },
          type: {
            name: 'string',
            required: false,
          },
        },
      },
    } as ComponentMeta<typeof PrismThemeToggle>;
    
    const Template: ComponentStory<typeof PrismThemeToggle> = (args) => (
      <PrismThemeToggle {...args} />
    );
    
    /**
     * Toggle Stories - Prism theme
     */
    export const PrismTheme = Template.bind({});