Skip to content

Commit

Permalink
Merge pull request #4 from eea/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
avoinea committed Feb 8, 2023
2 parents 22892b7 + e2546ed commit 2c28161
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 19 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file. Dates are d

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

### [1.0.3](https://github.com/eea/volto-widget-theme-picker/compare/1.0.2...1.0.3) - 8 February 2023

#### :hammer_and_wrench: Others

- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`de3314a`](https://github.com/eea/volto-widget-theme-picker/commit/de3314a716dae4d38cac81f4fa6733d904712d07)]
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`c576cc7`](https://github.com/eea/volto-widget-theme-picker/commit/c576cc79bc481cf67c6b592e4baea6477d07e5ae)]
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`19d97ad`](https://github.com/eea/volto-widget-theme-picker/commit/19d97ad979ea739f001159765ea529bf647ab022)]
- back to no theme / undefined [andreiggr - [`e046c5f`](https://github.com/eea/volto-widget-theme-picker/commit/e046c5fb332180a4dd43d07512284c6be8d8a0ed)]
### [1.0.2](https://github.com/eea/volto-widget-theme-picker/compare/1.0.1...1.0.2) - 3 February 2023

#### :hammer_and_wrench: Others
Expand Down
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pipeline {
environment {
GIT_NAME = "volto-widget-theme-picker"
NAMESPACE = "@eeacms"
SONARQUBE_TAGS = "volto.eea.europa.eu"
SONARQUBE_TAGS = "volto.eea.europa.eu,demo-www.eea.europa.eu,prod-www.eea.europa.eu"
DEPENDENCIES = ""
VOLTO = "alpha"
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eeacms/volto-widget-theme-picker",
"version": "1.0.2",
"version": "1.0.3",
"description": "@eeacms/volto-widget-theme-picker: Volto add-on",
"main": "src/index.js",
"author": "European Environment Agency: IDM2 A-Team",
Expand Down
21 changes: 5 additions & 16 deletions src/Widgets/ThemePicker.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,11 @@ import { Form } from 'semantic-ui-react';
import { Grid, Button } from 'semantic-ui-react';

const ThemePicker = (props) => {
const {
id,
title,
required,
defaultValue = 'default',
value,
onChange,
colors,
className,
} = props;
const { id, title, required, value, onChange, colors, className } = props;

React.useEffect(() => {
if (!value && defaultValue) {
onChange(id, defaultValue);
}
});
const handleChange = (e, { value }) => {
onChange(id, value);
};

return colors && colors.length > 0 ? (
<Form.Field
Expand Down Expand Up @@ -46,7 +35,7 @@ const ThemePicker = (props) => {
onClick={(e) => {
e.preventDefault();
e.stopPropagation();
onChange(id, color.name);
handleChange(e, { value: color.name });
}}
active={value === color.name}
circular
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const applyConfig = (config) => {
config.widgets.widget.theme_picker = ThemePickerWidget;

config.settings.themeColors = [
{ value: 'default', title: 'Default' },
{ value: undefined, title: 'No theme' },
{ value: 'primary', title: 'Primary' },
{ value: 'secondary', title: 'Secondary' },
{ value: 'tertiary', title: 'Tertiary' },
Expand Down

0 comments on commit 2c28161

Please sign in to comment.