Download spectrum/src/reducers/titlebar.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 614 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/spectrum/src/reducers/titlebar.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/spectrum/src/reducers/titlebar.js
-
curl -L -o titlebar.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/spectrum/src/reducers/titlebar.js
614 Bytes
| // @flow | |
| const initialState = { | |
| title: '', | |
| titleIcon: null, | |
| rightAction: null, | |
| leftAction: 'menu', | |
| }; | |
| export default function titlebar( | |
| state: typeof initialState = initialState, | |
| action: Object | |
| ) { | |
| const { type, payload } = action; | |
| switch (type) { | |
| case 'SET_TITLEBAR_PROPS': { | |
| return Object.assign({}, state, { | |
| title: payload.title && payload.title, | |
| titleIcon: payload.titleIcon && payload.titleIcon, | |
| rightAction: payload.rightAction && payload.rightAction, | |
| leftAction: payload.leftAction || 'menu', | |
| }); | |
| } | |
| default: | |
| return state; | |
| } | |
| } | |