Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 3.22.0 #1247

Merged
merged 93 commits into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
0821879
Fix the routerContext call
dtrucs Aug 8, 2024
c69bc32
Install next-router-mock package
dtrucs Aug 8, 2024
aedc291
Mock next/router for unit tests
dtrucs Aug 8, 2024
23986db
Define "types": ["@testing-library/jest-dom"] to tsconfig
dtrucs Aug 8, 2024
383a52e
Bump @testing-library packages
dtrucs Aug 8, 2024
e750fc2
Bump leaflet.locatecontrol from 0.74.0 to 0.81.1
dtrucs Aug 21, 2024
9cfbe89
Create LocateControl component
dtrucs Aug 21, 2024
8fe732c
Use LocateControl component in maps
dtrucs Aug 21, 2024
8b1ec7d
Remove the locateControl call from useTileLayer hook
dtrucs Aug 21, 2024
9322a17
Prevent map zooming when scrolling the elevation profile
dtrucs Aug 22, 2024
de379da
Fix of mobile menu sub-filters
dtrucs Aug 27, 2024
a0ff637
Define annotation_type in viewpoint module
dtrucs Aug 23, 2024
958e946
Display annotation type in annotation tooltip
dtrucs Aug 23, 2024
0eb8c96
Allows to forward props to Map icon component
dtrucs Aug 23, 2024
bfd446e
Add "Display in HD pictures" button at the map bottom
dtrucs Aug 23, 2024
8878ec4
Apply suggestions from code review
dtrucs Aug 26, 2024
6df4974
Define icon as marker for annotation with defined category
dtrucs Aug 27, 2024
4b7da51
Apply suggestions from code review
dtrucs Aug 27, 2024
481a170
Bump docker/build-push-action from 5 to 6
dependabot[bot] Jun 17, 2024
0e98ff0
Use tailwind instead of styled component for rando3D component
dtrucs May 22, 2024
666ad43
Move font-size from Information component to parents
dtrucs May 22, 2024
a1c0c7e
Use tailwind and improve semantics for Accessibility component
dtrucs May 22, 2024
0231bf4
Use tailwind instead of styled-component for AppCrashFallback component
dtrucs May 22, 2024
d8ac4cc
Use tailwind instead of styled-component for CardIcon component
dtrucs May 22, 2024
73dbdcb
Use tailwind instead of styled-component for DetailsMapDrawer component
dtrucs May 22, 2024
8498375
Improve a11y to DetailsMapsDrawer component
dtrucs May 22, 2024
ae9d0d7
Use tailwind instead of styled-component for MapReportButton component
dtrucs May 22, 2024
5c83ff1
Use tailwind instead of styled-component for Popup component
dtrucs May 22, 2024
1492373
Use tailwind instead of styled-component for FilterBar component
dtrucs May 22, 2024
30a09d1
Use tailwind instead of styled-component for MobileFilterMenu component
dtrucs May 22, 2024
709e408
Use tailwind instead of styled-component for DetailsSensitiveArea com…
dtrucs May 23, 2024
b19cab9
Add animation-delay properties to tailwind config
dtrucs May 23, 2024
6e47c60
Use tailwind instead of styled-component for Loader component
dtrucs May 23, 2024
d49e0de
Remove useless HomeCard component
dtrucs May 23, 2024
5517311
Use tailwind instead of styled-component for Siblings component
dtrucs May 23, 2024
4dab661
Use tailwind instead of styled-component for Cluster component
dtrucs May 23, 2024
cf414c3
Handle cluster size bubble for bigger number
dtrucs May 23, 2024
dc1d7df
Use tailwind instead of styled-component for PointsReferenceMarker co…
dtrucs May 23, 2024
dbc220a
Use tailwind instead of styled-component for Home component
dtrucs May 23, 2024
6c879fb
Use tailwind instead of styled-component for DetailsTrekFamilyCarouse…
dtrucs May 23, 2024
5e58a8a
Use tailwind instead of styled-component for Tooltip component
dtrucs May 23, 2024
91d4820
Use tailwind instead of styled-component for InputDataWithMagnifier c…
dtrucs May 23, 2024
444825c
Use tailwind instead of styled-component for InputWithMagnifier compo…
dtrucs May 23, 2024
65c1a92
Clean useless CSS selectors
dtrucs May 23, 2024
ed910bf
Define CSS selector to use text-shadow
dtrucs May 23, 2024
24ee310
Remove useless CSSReset
dtrucs May 23, 2024
6ce294a
Create locales for carousel buttons
dtrucs May 27, 2024
4aecc2b
Use tailwind instead of styled-component for BannerCarousel component
dtrucs May 27, 2024
76bfc58
Use tailwind instead of styled-component for Carousel component
dtrucs May 27, 2024
4bba721
Use tailwind instead of styled-component for DetailsCardSection compo…
dtrucs May 27, 2024
bb02384
Use tailwind instead of styled-component for Accessibility component
dtrucs May 27, 2024
0fba1cd
Create CSS for content-WYSIWYG
dtrucs May 28, 2024
78569a9
Use content-WYSIWYG instead of styled-component
dtrucs May 28, 2024
00ebc96
Delete useless styled HtmlText
dtrucs May 28, 2024
c1d6daf
Use tailwind instead of stylesheet variable to style ActivitySearchFi…
dtrucs May 29, 2024
346eca9
Use tailwind variable instead of stylesheet variable for Details comp…
dtrucs May 29, 2024
2948f7a
Use tailwind variable instead of stylesheet variable for useHightligh…
dtrucs May 29, 2024
52e12be
Use tailwind variable instead of stylesheet variable for OutdoorCours…
dtrucs May 29, 2024
16e7f38
Use tailwind variable instead of stylesheet variable for OutdoorSiteU…
dtrucs May 29, 2024
7a03f3c
Use tailwind variable instead of stylesheet variable for TouristicEve…
dtrucs May 29, 2024
1ad5cb4
Use tailwind instead of stylesheet variable to use colors
dtrucs May 29, 2024
1534fb4
Remove useless styled-component helpers
dtrucs May 29, 2024
a0726ac
Remove stylehint config related to styled-component
dtrucs May 29, 2024
a836543
Remove packages related to styled-component
dtrucs May 29, 2024
63b6cb0
Update documentation related to styled-component
dtrucs May 29, 2024
433f785
Update plop generator without styled-component and redux
dtrucs May 29, 2024
092a0ce
Remove styledComponents compiler for next config
dtrucs Jul 18, 2024
1a68d84
Rename ambiguous getListOfColorsInPalette to listOfColorsInPalette
dtrucs Aug 8, 2024
430424a
Simplify the tailwind animation-delay plugin
dtrucs Aug 8, 2024
f894bab
Define larger search input
dtrucs Aug 22, 2024
f77358a
Rework field component
dtrucs Aug 22, 2024
68ee0e1
Redefine HTML default color
dtrucs Aug 22, 2024
044cc88
Fix some z-index issues
dtrucs Aug 23, 2024
b163590
Simplify detailsHeader styling
dtrucs Aug 23, 2024
7e33a65
Refacto Leaflet CustomControl wrapper
dtrucs Aug 29, 2024
1265fdc
Bump tailwind-merge from 2.2.2 to 2.5.2
dtrucs Aug 29, 2024
4bb1418
Install tailwindcss-animate package
dtrucs Aug 29, 2024
7fab3fd
Install class-variance-authority package
dtrucs Aug 29, 2024
c70a55d
Install @radix-ui/react-dialog package
dtrucs Aug 29, 2024
ca5b6b6
Allows to forward props to BurgerMenu icon component
dtrucs Aug 29, 2024
9015611
Allows to forward props to ArrowLeft icon component
dtrucs Aug 29, 2024
fa1b064
Connect tailwindcss-animate to tailwind config
dtrucs Aug 29, 2024
60ff02f
Create Sheet component
dtrucs Aug 29, 2024
3f196e7
Use Sheet to display MenuMobile
dtrucs Aug 29, 2024
930a279
Use Sheet to dusplay FilterMobile
dtrucs Aug 29, 2024
4c232de
Remove react-burger-menu package
dtrucs Aug 29, 2024
793d220
Simplify the connexion between filter button and sheet
dtrucs Sep 11, 2024
468292b
Avoid referencing unbound method for CarouselProps
dtrucs Aug 8, 2024
20602ae
Simplify ternary condition in BurgerMenuSection
dtrucs Aug 8, 2024
2183387
Bump @next/eslint-plugin-next and eslint-config-next packages to 14.2.10
dtrucs Aug 8, 2024
c5dac6d
Upgrade NodeJS version to 20
submarcos Jan 15, 2024
9df8a86
Bump @types/node from 16.9.4 to 22.5.4 in /frontend
dependabot[bot] Sep 9, 2024
983bc10
Bump package.json / 3.22.0
dtrucs Sep 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/geotrek-rando-builder

- name: Build and push Docker image
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: frontend
file: ./frontend/Dockerfile
Expand All @@ -45,7 +45,7 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}

- name: Build and push Docker image builder
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: frontend
file: ./frontend/Dockerfile
Expand Down
30 changes: 30 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,35 @@
# Changelog

## 3.22.0 (2024-09-17)

**✨ Improvements**

- Add annotation category (label and picto) to HD viewpoint map tooltip (#1229)
- Add "Display in HD pictures" button at the map bottom if the details page contains at least one HD viewpoint (#1229)
- Refacto to use the leaflet locate.control in a more “react” way (#1227 #1219)
- Refacto Leaflet CustomControl wrapper (#1237 #1219)
- Refacto sheet component (#1238 #1219)
- Prevent map zooming when scrolling on the elevation profile (#1228)
- Remove styled-component and handle styling only with tailwindCSS (#1147)

**🔧 Maintenance**

- Bump node from 18 to 20 (#1021)
- Bump @types/node from 16.9.4 to 22.5.4 in /frontend (#1244)
- Bump @next/eslint-plugin-next and eslint-config-next packages to 14.2.10 (#1217)
- Bump @testing-libray packages(#1218)
- Bump leaflet.locatecontrol from 0.74.0 to 0.81.1 (#1227)
- Install @radix-ui/react-dialog package
- Install class-variance-authority package
- Install tailwindcss-animate package
- Bump tailwind-merge from 2.2.2 to 2.5.2
- Bump docker/build-push-action from 5 to 6
- Remove react-burger-menu package

**🐛 Fixes**

- Fix display of mobile menu sub-filters (#1006 #1235)

## 3.21.1 (2024-07-29)

**🐛 Fixes**
Expand Down
2 changes: 1 addition & 1 deletion docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Installation in development:

## Prerequisite

- You need to use a node version equal or above 18
- You need to use a node version equal or above 20
- Use nvm and then:

```bash
Expand Down
7 changes: 5 additions & 2 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@ If you follow the [Install without Docker (not recommended)](#install-without-do
### Sentry

To report application crashes and any errors encountered by users, you can use [Sentry](https://sentry.io/).
In the Sentry backoffice, create your project and copy the DSN key which you can paste into the `SENTRY_DSN` environment variable.
In the Sentry backoffice, create your project and copy the DSN key which you can paste into the `SENTRY_DSN` environment variable.

# Install with Docker (recommended)

## Global process

Before starting the technical installation, here is an overview of the global process:

- Developers are working on code source of this repository where you will also find the documentation, issues and releases
- Once they have a new version of the application ready, they will release it, build a Docker image of this new version and push it in the [packages repository](https://github.com/orgs/GeotrekCE/packages/container/package/geotrek-rando-v3%2Fgeotrek-rando)
- If required, they will also make changes to the docker-compose file and customization template in the [installer dedicated repository](https://github.com/GeotrekCE/Geotrek-rando-v3-installer) and release a new version of it
Expand Down Expand Up @@ -103,6 +104,7 @@ sudo certbot --nginx
## Upgrade Geotrek-rando version

To find out the current Geotrek-rando version of your running container, you can execute (by renaming `rando-nodeserver-1` with the name of your container):

```
docker exec -t -i rando-nodeserver-1 node -p "require('./package.json').version"
```
Expand Down Expand Up @@ -147,7 +149,7 @@ Install nodejs:
sudo apt update
sudo apt -y upgrade
sudo apt -y install curl dirmngr apt-transport-https lsb-release ca-certificates
curl -sL https://deb.nodesource.com/setup_17.x | sudo -E bash -
curl -sL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt -y install nodejs
```

Expand All @@ -164,6 +166,7 @@ cd Geotrek-rando-v3/frontend/
```

Install dependencies

```sh
yarn
```
Expand Down
2 changes: 1 addition & 1 deletion frontend/.nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v18.12.0
v20.17.0
8 changes: 4 additions & 4 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
# Install dependencies only when needed
FROM node:18-alpine AS deps
FROM node:20-alpine AS deps
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk add --no-cache libc6-compat g++ gcc libgcc libstdc++ linux-headers make python3
WORKDIR /app
COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile

# Rebuild the source code only when needed
FROM node:18-alpine AS builder
FROM node:20-alpine AS builder
WORKDIR /app
COPY . .
COPY --from=deps /app/node_modules ./node_modules
RUN yarn build

FROM node:18-alpine AS builder_optim
FROM node:20-alpine AS builder_optim
WORKDIR /app
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/package.json ./package.json
COPY --from=builder /app/yarn.lock ./yarn.lock
RUN yarn install --production --ignore-scripts --prefer-offline

# Production image, copy all the files and run next
FROM node:18-alpine AS runner
FROM node:20-alpine AS runner
WORKDIR /app

ENV NODE_ENV production
Expand Down
20 changes: 5 additions & 15 deletions frontend/docs/design.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,21 @@
## 🏞 Design

### Styled Components 💅

Follow the code principles when using styled-components

- [Do not use className and classes](https://github.com/theodo/theodo-code-principles/pull/18/files)

### 💠 CSS

#### 🌀 Reset

There is a [`reset.css`](../public/reset.css) file that removes basic style attached to tags. The file is based on [meyerweb's example](https://meyerweb.com/eric/tools/css/reset/) and enriched by experience.

#### 🌈 Stylesheet
#### 🌈 Tailwind

[`stylesheet.ts`](../src/stylesheet.ts) is where you should declare all style properties used on this app.
[`tailwind.config.js`](../../tailwind.config.js) is where you should declare all style properties used on this app.

- colors
- font properties (size, font-faimly, boldness, line height)
- spacing measurement unit (ex: all margin, padding must be multiple of 8px)
- font properties (size, font-family, boldness, line height)
- spacing measurement unit (ex: all margin, padding must be multiple of 4px)
- screen size breakpoints
- shades
- ...

This way, you can manage the app look and feel from one file instead of several, and preserve consistency.

Import the style variables from the stylesheet to use them in your components.
Import the style variables from the `tailwind.config.js` to use them in your components.

#### 🔍 Linter

Expand Down
36 changes: 19 additions & 17 deletions frontend/docs/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,35 @@

Useful commands:

- `npm install` to install dependencies
- `yarn` to install dependencies

- `npm run start` to start a local dev-server
- `yarn start` to start a local dev-server

- `npm run build` to build a minified version of the code, for production use!
- `yarn build` to build a minified version of the code, for production use!

- `npm run dev` to use a development server which will take care of live-reloading and browser sync.
- `yarn dev` to use a development server which will take care of live-reloading and browser sync.

- `npm run test` to launch tests in watch mode
- `yarn lint` to analyse source code to flag programming errors

- `npm run e2e` to launch cypress end-to-end tests (after ```npm run dev```)
- `yarn tsc` to compile the project defined by `tsconfig.json`

- * `npm run generate` to generate a new component or a new page. You will be prompted the following questions:
- `yarn test` to launch tests in watch mode

* Do you want a page or a component?
* What is the name of the component?
* What is the type of the component? _Choose between [PureComponents](https://codeburst.io/when-to-use-component-or-purecomponent-a60cfad01a81), Components and stateless functions for your React component._
* Do you want to connect your component to the Redux store? _Use Redux to handle your global state._
* Do you want to use react-intl? _Use [react-intl](https://github.com/yahoo/react-intl/wiki/Components) to handle the translations within your application._
* Do you want to use styled-components? _Use [styled-components](https://github.com/styled-components/styled-components) to easily style your components using a CSS syntax._
* Do you want snapshot tests? _Snapshot tests allow you to easily lock the comportment of a component.
- `yarn e2e` to launch cypress end-to-end tests (after `yarn dev`)

- - `yarn generate` to generate a new component or a new page. You will be prompted the following questions:

- Do you want a page or a component?
- What is the name of the component?
- What is the type of the component? _Choose between [PureComponents](https://codeburst.io/when-to-use-component-or-purecomponent-a60cfad01a81), Components and stateless functions for your React component._
- Do you want to connect your component to the Redux store? _Use Redux to handle your global state._
- Do you want to use react-intl? _Use [react-intl](https://github.com/yahoo/react-intl/wiki/Components) to handle the translations within your application._
- Do you want snapshot tests? \_Snapshot tests allow you to easily lock the comportment of a component.

Other useful commands:

- `npm run lint:fix` to automatically fix linting errors
- `yarn lint:fix` to automatically fix linting errors

- `npm run test:coverage` to generate the coverage
- `yarn test:coverage` to generate the coverage

For more see [create-react-app documentation](https://github.com/facebookincubator/create-react-app)
- `yarn prepush` is a shortcut of `yarn lint && yarn tsc && yarn test`
1 change: 0 additions & 1 deletion frontend/docs/typescript.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ npm install --save-dev
@types/react-router
@types/react-router-dom
@types/react-test-renderer
@types/styled-components
@types/superagent
@types/webpack-env
```
Expand Down
8 changes: 2 additions & 6 deletions frontend/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@ const nextConfig = {
disableClientWebpackPlugin: true, //process.env.SENTRY_DSN === undefined,
},
publicRuntimeConfig: getAllConfigs,
compiler: {
styledComponents: true,
},
images: {
remotePatterns: [
{
Expand All @@ -71,6 +68,5 @@ const nextConfig = {
},
};

module.exports = async (phase, { defaultConfig }) => (
withPlugins(plugins, nextConfig)(phase, { ...defaultConfig, ...nextConfig })
);
module.exports = async (phase, { defaultConfig }) =>
withPlugins(plugins, nextConfig)(phase, { ...defaultConfig, ...nextConfig });
27 changes: 13 additions & 14 deletions frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "geotrek-rando-frontend",
"version": "3.21.1",
"version": "3.22.0",
"private": true,
"scripts": {
"debug": "NODE_OPTIONS='--inspect' next ./src",
Expand Down Expand Up @@ -37,6 +37,7 @@
"@20tab/react-leaflet-resetview": "^1.0.1",
"@hcaptcha/react-hcaptcha": "^1.4.4",
"@makina-corpus/rando3d": "^1.3.3",
"@radix-ui/react-dialog": "^1.1.1",
"@raruto/leaflet-elevation": "1.7.0",
"@react-hook/resize-observer": "^1.2.6",
"@sentry/nextjs": "^7.12.1",
Expand All @@ -45,6 +46,7 @@
"@zeit/next-source-maps": "^0.0.4-canary.1",
"autoprefixer": "^10.4.14",
"axios": "0.25.0",
"class-variance-authority": "^0.7.0",
"compression": "^1.7.4",
"cypress": "^13.6.3",
"debounce": "^1.2.1",
Expand All @@ -56,7 +58,7 @@
"leaflet": "^1.7.1",
"leaflet-boundary-canvas": "^1.0.0",
"leaflet-rastercoords": "^1.0.5",
"leaflet.locatecontrol": "0.74.0",
"leaflet.locatecontrol": "^0.81.1",
"leaflet.offline": "^3.0.1",
"next": "^13.1.6",
"next-compose-plugins": "^2.2.1",
Expand All @@ -65,7 +67,6 @@
"postcss": "8.3.6",
"react": "^18.2.0",
"react-accessible-accordion": "^5.0.0",
"react-burger-menu": "^3.0.9",
"react-country-flag": "^3.0.2",
"react-dom": "^18.2.0",
"react-infinite-scroll-component": "6.1.0",
Expand All @@ -82,52 +83,50 @@
"slick-carousel": "^1.8.1",
"store": "^2.0.12",
"striptags": "^3.2.0",
"styled-components": "^5.3.6",
"svgo": "^3.0.2",
"tailwind-merge": "^2.2.2",
"tailwind-merge": "^2.5.2",
"tailwindcss": "^3.4.1",
"tailwindcss-animate": "^1.0.7",
"ts-node": "^10.9.1",
"typesafe-actions": "^5.1.0",
"wait-on": "6.0.0"
},
"devDependencies": {
"@accessible/accordion": "^2.0.0",
"@next/bundle-analyzer": "^12.2.5",
"@next/eslint-plugin-next": "^14.1.1",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@next/eslint-plugin-next": "^14.2.10",
"@testing-library/dom": "^10.4.0",
"@testing-library/jest-dom": "^6.4.8",
"@testing-library/react": "^16.0.0",
"@types/debounce": "^1.2.1",
"@types/jest": "27.0.2",
"@types/leaflet": "1.7.5",
"@types/node": "16.9.4",
"@types/node": "22.5.4",
"@types/react": "^18.0.25",
"@types/react-burger-menu": "2.8.7",
"@types/react-dom": "^18.0.9",
"@types/react-leaflet": "2.8.2",
"@types/react-leaflet-markercluster": "^2.0.0",
"@types/react-loader": "2.4.5",
"@types/react-slick": "^0.23.10",
"@types/screenfull": "^4.1.0",
"@types/store": "^2.0.2",
"@types/styled-components": "5.1.14",
"eslint": "^8.57.0",
"eslint-config-next": "^14.1.1",
"eslint-config-next": "^14.2.10",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-jest-dom": "^5.1.0",
"eslint-plugin-testing-library": "^6.2.0",
"isomorphic-fetch": "^3.0.0",
"jest": "28",
"jest-environment-jsdom": "28",
"next-router-mock": "^0.9.13",
"next-server": "^9.0.5",
"nock": "13.1.3",
"prettier": "^3.2.5",
"react-addons-test-utils": "^15.6.2",
"stylelint": "13.13.1",
"stylelint-config-prettier": "^8.0.2",
"stylelint-config-standard": "22.0.0",
"stylelint-config-styled-components": "^0.1.1",
"stylelint-declaration-strict-value": "1.7.12",
"stylelint-processor-styled-components": "^1.10.0",
"typescript": "^5.3.3",
"typescript-eslint": "^7.1.0"
},
Expand Down
21 changes: 2 additions & 19 deletions frontend/scripts/generators/component/component.pure.tsx.hbs
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
import React, { PureComponent } from 'react';
import { PureComponent } from 'react';
{{#if wantMessages}}
import { intlShape, FormattedMessage } from 'react-intl';
{{/if}}

{{#unless wantStyledComponents}}
import './{{ properCase name }}.style.css';
{{/unless}}
{{#if wantStyledComponents}}
import Styled{{ properCase name }} from './{{ properCase name }}.style';
{{/if}}

interface IProps {
{{#if wantMessages}}
intl: intlShape,
Expand All @@ -19,21 +12,11 @@ interface IProps {
class {{ properCase name }} extends PureComponent<IProps> {
render() {
return (
{{#unless wantStyledComponents}}
<div className="{{ dashCase name }}-container">
{{/unless}}
{{#if wantStyledComponents}}
<Styled{{ properCase name }}>
{{/if}}
<div className="custo-{{ dashCase name }}">
{{#if wantMessages}}
<FormattedMessage id="please.change.me" />
{{/if}}
{{#unless wantStyledComponents}}
</div>
{{/unless}}
{{#if wantStyledComponents}}
</Styled{{ properCase name }}>
{{/if}}
);
}
}
Expand Down
Loading
Loading