blob: 8bb6ea3779a58ecaf8c3da0e384f0286d649e051 (
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
|
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>
);
};
|