Skip to content

Commit

Permalink
Merge branch 'master' into feature/ch120584/animate-category-widget-v…
Browse files Browse the repository at this point in the history
…alues
  • Loading branch information
neokore authored Nov 26, 2020
2 parents c0b9dc5 + 3a7af1f commit 6c3f203
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 26 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## Unreleased
# CHANGELOG

## Not released
- Fix CategoryWidgetUI displaying no data while loading [#26](https://github.com/CartoDB/carto-react-lib/pull/26)
- Animate CategoryWidget values [#30](https://github.com/CartoDB/carto-react-lib/pull/30)
- Make OAuthLogin component responsive [#28](https://github.com/CartoDB/carto-react-lib/pull/28)

## 1.0.0-beta5 (2020-11-25)
- Fix addSource keeping optional credentials property in the payload [#24](https://github.com/CartoDB/carto-react-lib/pull/24)
Expand Down
38 changes: 14 additions & 24 deletions src/oauth/OAuthLogin.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
import React from 'react';
import { useSelector, useDispatch } from 'react-redux';
import { makeStyles } from '@material-ui/core/styles';
import { Button, Grid } from '@material-ui/core';
import { Button, Hidden, IconButton } from '@material-ui/core';
import AccountCircleOutlinedIcon from '@material-ui/icons/AccountCircleOutlined';
import useOAuthLogin from './useOAuthLogin';
import { setTokenAndUserInfoAsync } from '../redux/oauthSlice';

const useStyles = makeStyles(() => ({
root: {
flexGrow: 1,
},
}));

/**
* Shows a login button.
* When this button is clicked, the OAuth protocol flow is handled
Expand All @@ -20,7 +14,6 @@ const useStyles = makeStyles(() => ({
*/
export default function OAuthLogin() {
const dispatch = useDispatch();
const classes = useStyles();
const oauthApp = useSelector((state) => state.oauth.oauthApp);

const onParamsRefreshed = (oauthParams) => {
Expand All @@ -35,20 +28,17 @@ export default function OAuthLogin() {
const [handleLogin] = useOAuthLogin(oauthApp, onParamsRefreshed);

return (
<div className={classes.root}>
<Grid
container
justify='flex-end'
alignItems='center'
spacing={1}
style={{ flexGrow: 1 }}
>
<Grid item>
<Button color='inherit' variant='outlined' onClick={handleLogin}>
Login
</Button>
</Grid>
</Grid>
</div>
<React.Fragment>
<Hidden xsDown>
<Button color="inherit" variant="outlined" onClick={handleLogin}>
Login
</Button>
</Hidden>
<Hidden smUp>
<IconButton color="inherit" aria-label="Login" onClick={handleLogin}>
<AccountCircleOutlinedIcon />
</IconButton>
</Hidden>
</React.Fragment>
);
}
7 changes: 7 additions & 0 deletions src/ui/theme/carto-theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,13 @@ export const cartoThemeOptions = {
background: variables.palette.action.focus,
outline: 'none',
},

// Mapbox controls
'.mapboxgl-ctrl-bottom-left, .mapboxgl-ctrl-bottom-right': {
'@media (max-width: 600px)': { // sm
bottom: spacing(4)
}
}
},
},

Expand Down
2 changes: 1 addition & 1 deletion src/ui/widgets/CategoryWidgetUI.js
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ function CategoryWidgetUI(props) {
}
/>
))
: data.length === 0 && (
: (data.length === 0 && !loading) && (
<Alert severity='warning'>
<AlertTitle>NO DATA AVAILABLE</AlertTitle>
There are no results for the combination of filters applied to your
Expand Down

0 comments on commit 6c3f203

Please sign in to comment.