Skip to content

Commit

Permalink
Merge pull request #39 from Pyrrha-Platform/ul-linter
Browse files Browse the repository at this point in the history
Ul linter
  • Loading branch information
krook authored Aug 3, 2021
2 parents f057c10 + 5abd40e commit 7616533
Show file tree
Hide file tree
Showing 19 changed files with 121 additions and 101 deletions.
2 changes: 1 addition & 1 deletion .github/issue_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ A clear and concise description of what you want to happen.
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
Add any other context or screenshots about the feature request here.
22 changes: 22 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: linter

on:
# Execute on every push to any branch
push:
branches:
- "**"
# Execute on every pull request to the master branch
pull_request_target:
branches:
- main

jobs:
linter:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up node
uses: actions/setup-node@v1
- run: npm install -g [email protected]
- run: prettier --check .
24 changes: 12 additions & 12 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,21 @@ our community a harassment-free experience for everyone, regardless of age, body
Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
- The use of sexualized language or imagery and unwelcome sexual attention or
advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
- Other conduct which could reasonably be considered inappropriate in a
professional setting

### Our Responsibilities
Expand Down Expand Up @@ -82,4 +82,4 @@ members of the project's leadership.
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
[version]: http://contributor-covenant.org/version/1/4/
6 changes: 3 additions & 3 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Landing from './pages/Landing';
import Landing from "./pages/Landing";

import AppContext, { useAppContext } from './context/app';
import './styles/App.scss';
import AppContext, { useAppContext } from "./context/app";
import "./styles/App.scss";

function App() {
return (
Expand Down
6 changes: 3 additions & 3 deletions src/components/Banner.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useContext } from 'react';
import React, { useContext } from "react";

import AppContext from '../context/app';
import AppContext from "../context/app";

const Banner = () => {
const { t } = useContext(AppContext);
Expand All @@ -13,7 +13,7 @@ const Banner = () => {
</div>
</div>
<div className="landing__mission">
<h2>{t('bannerMission')}</h2>
<h2>{t("bannerMission")}</h2>
</div>
</section>
);
Expand Down
4 changes: 2 additions & 2 deletions src/components/Diagram.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import landscape from '../content/assets/Prometeo_header.jpg';
import React from "react";
import landscape from "../content/assets/Prometeo_header.jpg";

const Banner = () => {
return (
Expand Down
16 changes: 8 additions & 8 deletions src/components/Footer.js
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
import React, { useContext } from 'react';
import AppContext from '../context/app';
import React, { useContext } from "react";
import AppContext from "../context/app";

const Footer = (props) => {
const { t } = useContext(AppContext);

return (
<footer>
<h4>
{t('footer')}
{t("footer")}
<a
href="https://www.linuxfoundation.org/projects/call-for-code/"
rel="noopener noreferrer"
target="_blank"
>
{t('footerLink')}
{t("footerLink")}
</a>
{t('footer2')}
{t("footer2")}
<a
href="https://pyrrha-project.org/"
rel="noopener noreferrer"
target="_blank"
>
{t('footerLink2')}
{t("footerLink2")}
</a>
</h4>
<p>{t('copyright')}</p>
<small>{t('copyrightInfo')}</small>
<p>{t("copyright")}</p>
<small>{t("copyrightInfo")}</small>
</footer>
);
};
Expand Down
14 changes: 7 additions & 7 deletions src/components/Header.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import React, { useContext } from 'react';
import React, { useContext } from "react";
import {
Header,
HeaderName,
HeaderGlobalAction,
HeaderGlobalBar
} from 'carbon-components-react/lib/components/UIShell';
import LogoGitHub20 from '@carbon/icons-react/lib/logo--github/20';
import LogoSlack20 from '@carbon/icons-react/lib/logo--slack/20';
HeaderGlobalBar,
} from "carbon-components-react/lib/components/UIShell";
import LogoGitHub20 from "@carbon/icons-react/lib/logo--github/20";
import LogoSlack20 from "@carbon/icons-react/lib/logo--slack/20";

import AppContext from '../context/app';
import AppContext from "../context/app";

const _Header = () => {
const { t } = useContext(AppContext);

return (
<Header aria-label="Pyrrha" className="header--container">
<HeaderName href="/" prefix="">
{t('title')}
{t("title")}
</HeaderName>

{/*
Expand Down
12 changes: 5 additions & 7 deletions src/components/Sensors.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ const SensorInfo = () => {
<Column lg={8}>
<h3>{t("technologyDescription2")}</h3>
<Column lg={{ span: 6, offset: 0 }}>
<a href={deviceFull}><img className="device" src={device} alt="Pyrrha device" /></a>
<a href={deviceFull}>
<img className="device" src={device} alt="Pyrrha device" />
</a>
</Column>
<h3>{t("technologyDescription3")}</h3>
<Column lg={{ span: 6, offset: 0 }}>
Expand Down Expand Up @@ -194,14 +196,10 @@ const NetworkInfo = () => {
<li>{t("teamDescription6")}</li>
</ol>
</Column>
<Column lg={{ span: 3, offset: 1 }}>

</Column>
<Column lg={{ span: 3, offset: 1 }}></Column>
</Row>
<Row className="info-media">
<Column lg={{ span: 11, offset: 4 }}>

</Column>
<Column lg={{ span: 11, offset: 4 }}></Column>
</Row>
</Grid>
</section>
Expand Down
34 changes: 17 additions & 17 deletions src/components/WhoWeAre.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useContext } from 'react';
import { Grid, Row, Column, Button, ButtonSet } from 'carbon-components-react';
import AppContext from '../context/app';
import React, { useContext } from "react";
import { Grid, Row, Column, Button, ButtonSet } from "carbon-components-react";
import AppContext from "../context/app";

const WhoWeAre = () => {
const { t } = useContext(AppContext);
Expand All @@ -10,46 +10,46 @@ const WhoWeAre = () => {
<Grid className="landing__whoWeAre">
<Row>
<Column lg={16}>
<h3>{t('informationTitle')}</h3>
<p>{t('informationFirstPara')}</p>
<h3>{t("informationTitle")}</h3>
<p>{t("informationFirstPara")}</p>
{/* <p>{t('informationSecPara')}</p> */}

<ButtonSet className="landing__buttonSet">
<Button
kind="primary"
onClick={() => {
window.open(
'https://github.com/Pyrrha-Platform/Pyrrha/blob/main/GET_INVOLVED.md',
'_blank',
'noopener'
"https://github.com/Pyrrha-Platform/Pyrrha/blob/main/GET_INVOLVED.md",
"_blank",
"noopener"
);
}}
>
{t('pyrrhaButtonGetInvolved')}
{t("pyrrhaButtonGetInvolved")}
</Button>
<Button
kind="tertiary"
onClick={() => {
window.open(
'http://callforcode.org/slack',
'_blank',
'noopener'
"http://callforcode.org/slack",
"_blank",
"noopener"
);
}}
>
{t('pyrrhaButtonJoinSlack')}
{t("pyrrhaButtonJoinSlack")}
</Button>
<Button
kind="tertiary"
onClick={() => {
window.open(
'https://github.com/Pyrrha-Platform',
'_blank',
'noopener'
"https://github.com/Pyrrha-Platform",
"_blank",
"noopener"
);
}}
>
{t('pyrrhaButtonBrowseCode')}
{t("pyrrhaButtonBrowseCode")}
</Button>
</ButtonSet>
</Column>
Expand Down
4 changes: 2 additions & 2 deletions src/context/app.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createContext } from 'react';
import { useTranslation } from 'react-i18next';
import { createContext } from "react";
import { useTranslation } from "react-i18next";

export default createContext({});

Expand Down
12 changes: 6 additions & 6 deletions src/i18n.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import i18n from 'i18next';
import { initReactI18next } from 'react-i18next';
import en from './content/en.json';
import i18n from "i18next";
import { initReactI18next } from "react-i18next";
import en from "./content/en.json";

i18n.use(initReactI18next).init({
fallbackLng: 'en',
fallbackLng: "en",
resources: {
en: { translations: en },
},
defaultNS: 'translations',
defaultNS: "translations",
interpolation: { escapeValue: false },
});
i18n.languages = ['en'];
i18n.languages = ["en"];

export default i18n;
14 changes: 7 additions & 7 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import React from 'react';
import ReactDOM from 'react-dom';
import './index.scss';
import App from './App';
import reportWebVitals from './reportWebVitals';
import React from "react";
import ReactDOM from "react-dom";
import "./index.scss";
import App from "./App";
import reportWebVitals from "./reportWebVitals";

import './i18n';
import "./i18n";

ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById('root')
document.getElementById("root")
);

// If you want to start measuring performance in your app, pass a function
Expand Down
10 changes: 5 additions & 5 deletions src/index.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '@carbon/themes/scss/themes';
@import "@carbon/themes/scss/themes";

$carbon--theme: $carbon--theme--g100;
@include carbon--theme();
Expand All @@ -8,11 +8,11 @@ $feature-flags: (
grid-columns-16: true,
);

@import '@carbon/type/scss/type';
@import '@carbon/type/scss/font-face/mono';
@import '@carbon/type/scss/font-face/sans';
@import "@carbon/type/scss/type";
@import "@carbon/type/scss/font-face/mono";
@import "@carbon/type/scss/font-face/sans";
@include carbon--type-reset();
@include carbon--font-face-mono();
@include carbon--font-face-sans();

@import 'carbon-components/scss/globals/scss/styles.scss';
@import "carbon-components/scss/globals/scss/styles.scss";
12 changes: 6 additions & 6 deletions src/pages/Landing.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from 'react';
import Header from '../components/Header';
import { SensorInfo, DashboardInfo, NetworkInfo } from '../components/Sensors';
import Banner from '../components/Banner';
import WhoWeAre from '../components/WhoWeAre';
import Footer from '../components/Footer';
import React from "react";
import Header from "../components/Header";
import { SensorInfo, DashboardInfo, NetworkInfo } from "../components/Sensors";
import Banner from "../components/Banner";
import WhoWeAre from "../components/WhoWeAre";
import Footer from "../components/Footer";

const Landing = () => {
return (
Expand Down
4 changes: 2 additions & 2 deletions src/reportWebVitals.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const reportWebVitals = onPerfEntry => {
const reportWebVitals = (onPerfEntry) => {
if (onPerfEntry && onPerfEntry instanceof Function) {
import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
import("web-vitals").then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
getCLS(onPerfEntry);
getFID(onPerfEntry);
getFCP(onPerfEntry);
Expand Down
2 changes: 1 addition & 1 deletion src/setupTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
// allows you to do things like:
// expect(element).toHaveTextContent(/react/i)
// learn more: https://github.com/testing-library/jest-dom
import '@testing-library/jest-dom';
import "@testing-library/jest-dom";
Loading

0 comments on commit 7616533

Please sign in to comment.