forked from processing/p5.js-web-editor
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into refactor/user.controller
- Loading branch information
Showing
16 changed files
with
60 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,18 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { connect } from 'react-redux'; | ||
import { useSelector } from 'react-redux'; | ||
import { ThemeProvider } from 'styled-components'; | ||
import theme from '../../../theme'; | ||
|
||
import theme, { Theme } from '../../../theme'; | ||
|
||
const Provider = ({ children, currentTheme }) => ( | ||
<ThemeProvider theme={{ ...theme[currentTheme] }}>{children}</ThemeProvider> | ||
); | ||
const Provider = ({ children }) => { | ||
const currentTheme = useSelector((state) => state.preferences.theme); | ||
return ( | ||
<ThemeProvider theme={{ ...theme[currentTheme] }}>{children}</ThemeProvider> | ||
); | ||
}; | ||
|
||
Provider.propTypes = { | ||
children: PropTypes.node.isRequired, | ||
currentTheme: PropTypes.oneOf(Object.keys(Theme)).isRequired | ||
children: PropTypes.node.isRequired | ||
}; | ||
|
||
function mapStateToProps(state) { | ||
return { | ||
currentTheme: state.preferences.theme | ||
}; | ||
} | ||
|
||
export default connect(mapStateToProps)(Provider); | ||
export default Provider; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,13 @@ | ||
import * as ActionTypes from '../../../constants'; | ||
import { createSlice } from '@reduxjs/toolkit'; | ||
|
||
const loading = (state = false, action) => { | ||
switch (action.type) { | ||
case ActionTypes.START_LOADING: | ||
return true; | ||
case ActionTypes.STOP_LOADING: | ||
return false; | ||
default: | ||
return state; | ||
const loadingSlice = createSlice({ | ||
name: 'loading', | ||
initialState: false, | ||
reducers: { | ||
startLoader: () => true, | ||
stopLoader: () => false | ||
} | ||
}; | ||
}); | ||
|
||
export default loading; | ||
export const { startLoader, stopLoader } = loadingSlice.actions; | ||
export default loadingSlice.reducer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import { initialState as initialFilesState } from '../modules/IDE/reducers/files'; | ||
import { initialState as initialPrefState } from '../modules/IDE/reducers/preferences'; | ||
|
||
const mockProjects = [ | ||
{ | ||
|
@@ -46,20 +47,7 @@ const initialTestState = { | |
parentId: undefined | ||
}, | ||
files: initialFilesState(), | ||
preferences: { | ||
fontSize: 18, | ||
autosave: true, | ||
linewrap: true, | ||
lineNumbers: true, | ||
lintWarning: false, | ||
textOutput: false, | ||
gridOutput: false, | ||
theme: 'light', | ||
autorefresh: false, | ||
language: 'en-US', | ||
autocloseBracketsQuotes: true, | ||
autocompleteHinter: false | ||
}, | ||
preferences: initialPrefState, | ||
user: { | ||
email: '[email protected]', | ||
username: 'happydog', | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters