You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
800 B
25 lines
800 B
const React = require('react');
|
|
|
|
module.exports = function FlattenButton({ setIsFlat, isFlat }) {
|
|
return (
|
|
<div className="toggle">
|
|
<div className="toggle__label">Files:</div>
|
|
<div className="toggle__options">
|
|
<button
|
|
onClick={() => setIsFlat(!isFlat)}
|
|
className={
|
|
'toggle__option ' + (!isFlat ? 'is-toggled' : '')
|
|
}
|
|
>
|
|
Tree
|
|
</button>
|
|
<button
|
|
onClick={() => setIsFlat(!isFlat)}
|
|
className={'toggle__option ' + (isFlat ? 'is-toggled' : '')}
|
|
>
|
|
Flat
|
|
</button>
|
|
</div>{' '}
|
|
</div>
|
|
);
|
|
};
|
|
|