Skip to content

Commit

Permalink
Feat: Change the old Webinar promote bar to the new one and update so…
Browse files Browse the repository at this point in the history
…me eslint rules (#232)

* feat: add react-hook plugin to eslint

* ref: change take a tour structure and labels

* ESLint formatting

* Adding a space at the end

---------

Co-authored-by: Travis Jenkins <[email protected]>
  • Loading branch information
flavioriper and travjenkins authored Mar 19, 2024
1 parent 2cadcdc commit 2d1e709
Show file tree
Hide file tree
Showing 8 changed files with 454 additions and 547 deletions.
10 changes: 8 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
/* eslint-env node */

module.exports = {
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'plugin:prettier/recommended'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
'plugin:react-hooks/recommended',
],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
plugins: ['@typescript-eslint', 'react-hooks'],
root: true,
rules: {
'@typescript-eslint/no-unused-vars': 'error',
Expand All @@ -28,6 +33,7 @@ module.exports = {
'react/display-name': 'off',
'react/prop-types': 'off',
'react/react-in-jsx-scope': 'off',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'error',
},
};
3 changes: 2 additions & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"endOfLine": "auto",
"singleQuote": true,
"bracketSpacing": true,
"printWidth": 120
"printWidth": 120,
"tabWidth": 2
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-react-hooks": "^4.6.0",
"gatsby-plugin-webpack-bundle-analyser-v2": "^1.1.30",
"prettier": "3.2.5",
"typescript": "^5.4.2"
Expand Down
847 changes: 374 additions & 473 deletions src/components/ConnectorPage.tsx

Large diffs are not rendered by default.

41 changes: 0 additions & 41 deletions src/components/TakeATour.tsx

This file was deleted.

35 changes: 35 additions & 0 deletions src/components/TakeATour/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import React, { useCallback, useEffect, useState } from 'react';

import CloseIcon from '@mui/icons-material/Close';

import { Button, Container, Link } from './styles';

const STORAGE_NAME = '@estuary/closeTour';

const TakeATour = () => {
const [closeTour, setCloseTour] = useState(true);

const onClick = useCallback(() => {
localStorage.setItem(STORAGE_NAME, '1');
setCloseTour(true);
}, []);

useEffect(() => {
if (typeof window !== 'undefined') setCloseTour(!!localStorage.getItem(STORAGE_NAME));
}, []);

if (closeTour) return null;

return (
<Container>
<Link target="_blank" href="https://try.estuary.dev/how-to-build-an-ai-pipeline/">
"How to Build Pipelines for Gen AI" - Join our April 10th webinar
</Link>
<Button onClick={onClick}>
<CloseIcon color="inherit" fontSize="small" />
</Button>
</Container>
);
};

export default TakeATour;
34 changes: 34 additions & 0 deletions src/components/TakeATour/styles.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import styled from 'styled-components';

import IconButton from '@mui/material/IconButton';
import { OutboundLink } from '../OutboundLink';

export const Container = styled.div`
background-color: #5072eb;
height: 24px;
display: flex;
justify-content: center;
align-items: center;
position: fixed;
top: 0;
width: 100%;
z-index: 99999;
display: none;
font-weight: 700;
@media (min-width: 1024px) {
display: flex;
}
`;

export const Link = styled(OutboundLink)`
font-size: 12px;
text-decoration-line: underline;
color: #fff;
`;

export const Button = styled(IconButton)`
color: #fff;
position: absolute;
right: 5px;
`;
30 changes: 0 additions & 30 deletions src/style.less
Original file line number Diff line number Diff line change
Expand Up @@ -624,36 +624,6 @@ input {

/* SECTION ONE */

.take-a-tour {
background-color: #5072eb;
height: 24px;
display: flex;
justify-content: center;
align-items: center;
position: fixed;
top: 0;
width: 100%;
z-index: 99999;
display: none;
font-weight: 700;

& a {
font-size: 12px;
text-decoration-line: underline;
color: #fff;
}

& button {
color: #fff;
position: absolute;
right: 5px;
}

@media (min-width: 1024px) {
display: flex;
}
}

.section-one {
padding-left: ~"calc(min(9%, 146px))";
display: flex;
Expand Down

0 comments on commit 2d1e709

Please sign in to comment.