react-feather#Maximize2 JavaScript Examples

The following examples show how to use react-feather#Maximize2. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: help.js    From hivemind with Apache License 2.0 6 votes vote down vote up
CollapsibleExample = ({ children }) => {
  const [isOpen, setOpen] = useState(false)

  const toggle = () => setOpen(!isOpen)

  return (
    <>
      <Button
        size="sm"
        color="primary"
        onClick={() => toggle()}
        style={{ marginBottom: '1rem' }}
      >
        {isOpen ? (
          <>
            <Minimize2 /> Close
          </>
        ) : (
          <>
            <Maximize2 /> Open
          </>
        )}{' '}
        Example
      </Button>
      <Collapse isOpen={isOpen}>{children}</Collapse>
      <hr />
    </>
  )
}
Example #2
Source File: layout-selector.js    From covid19-dashboard with MIT License 4 votes vote down vote up
DesktopLayoutSelector = ({selected, layouts, handleSelect}) => {
  const {isIframe, selectedLayout} = useContext(AppContext)
  const themeContext = useContext(ThemeContext)

  return (
    <div className='layout-selector-container'>
      <div className='nav'>
        {layouts.map(layout => (
          <div
            key={layout.id}
            className={`layout ${selected.id === layout.id ? 'selected' : ''}`}
            onClick={() => handleSelect(layout)}
          >
            {layout.label}
          </div>
        ))}
      </div>

      {isIframe && (
        <a href={selectedLayout.id === 'entreprises' ? AIDES_ENTREPRISES_URL : SITE_URL} className='maximize' target='_top'><Maximize2 style={{verticalAlign: 'middle'}} /></a>
      )}

      <style jsx>{`
        .layout-selector-container {
          display: flex;
          padding: 0.2em 1em;
          flex: 1;
          background-color: ${themeContext.primary};
          justify-content: center;
          align-items: center;
        }

        .nav {
          display: flex;
        }

        .layout {
          padding: 0.8em 0.5em;
          font-size: smaller;
          list-style: none;
          text-align: center;
          background-color: ${themeContext.secondary};
          color: #fff;
        }

        .layout:first-child {
          border-bottom-left-radius: 4px;
          border-top-left-radius: 4px;
        }

        .layout:last-child {
          border-bottom-right-radius: 4px;
          border-top-right-radius: 4px;
        }

        .layout.selected {
          color: ${themeContext.primary};
          background-color: #fff;
        }

        .layout:hover {
          cursor: pointer;
          background-color: ${themeContext.alt};
          color: #fff;
        }

        .maximize {
          color: #fff;
          margin: 0.4em;
          padding: 0.4em;
        }

        .maximize:hover {
          cursor: pointer;
          color: ${themeContext.primary};
          background-color: #fff;
          border-radius: 4px;
        }

        @media (max-width: 1370px) {
          .layout {
            font-size: small;
          }
        }

        @media (max-width: 1260px) {
          .layout {
            padding: .2em .8em;
          }
        }
        `}</style>
    </div>
  )
}