-
Notifications
You must be signed in to change notification settings - Fork 0
Create basic app structure. Add deploy-dev pipeline #7
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
base: main
Are you sure you want to change the base?
Changes from all commits
9e96c85
098c92e
f23da3c
5f96996
80a4491
b6a8069
11cca0a
e3584df
a06bb03
7db6e85
4076f86
707abd7
633c09e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,10 +15,16 @@ jobs: | |
with: | ||
node-version: 18 | ||
|
||
- name: Configure git profile | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
run: | | ||
git config --global user.email "amsterget@gmail.com" | ||
git config --global user.name "amsterget" | ||
git remote set-url origin https://${{ secrets.GIT_HUB_PERSONAL_TOKEN }}@github.com/${{ github.repository }} | ||
|
||
- name: Install of node dependencies | ||
run: sh install-modules.sh | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | ||
GITHUB_TOKEN: ${{ secrets.GIT_HUB_PERSONAL_TOKEN }} | ||
|
||
- name: Deploy | ||
run: npm run deploy |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
source ./.env | ||
|
||
npm config set //npm.pkg.github.com/:_authToken=${GITHUB_TOKEN} | ||
npm config set //npm.pkg.github.com/:_authToken=${GITHUB_TOKEN} | ||
npm config set @aikray:registry=https://npm.pkg.github.com/ | ||
|
||
npm install |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,4 @@ | ||
.App { | ||
text-align: center; | ||
} | ||
|
||
.App-logo { | ||
height: 40vmin; | ||
pointer-events: none; | ||
} | ||
|
||
@media (prefers-reduced-motion: no-preference) { | ||
.App-logo { | ||
animation: App-logo-spin infinite 20s linear; | ||
} | ||
} | ||
|
||
.App-header { | ||
background-color: #282c34; | ||
min-height: 100vh; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
font-size: calc(10px + 2vmin); | ||
color: white; | ||
} | ||
|
||
.App-link { | ||
color: #61dafb; | ||
} | ||
|
||
@keyframes App-logo-spin { | ||
from { | ||
transform: rotate(0deg); | ||
} | ||
to { | ||
transform: rotate(360deg); | ||
} | ||
height: 100%; | ||
width: 100%; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Width is 100% by default, sicne it's a |
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,30 @@ | ||
import './App.css'; | ||
|
||
import { fetchQuery } from 'core/fetchQuery'; | ||
import { useEffect, useState } from 'react'; | ||
import { useEffect } from 'react'; | ||
|
||
import logo from './logo.svg'; | ||
import { InitialDataProvider } from './providers/initial-data-provider'; | ||
import { Router } from './routes/Router'; | ||
|
||
export const App = () => { | ||
const [appStatus, setAppStatus] = useState(''); | ||
|
||
useEffect(() => { | ||
const getAppStatus = async () => { | ||
const response = await fetchQuery<{ status: string }>({ | ||
path: `/app/health-check`, | ||
}); | ||
|
||
setAppStatus(response.status); | ||
// eslint-disable-next-line no-console | ||
console.log(response.status); | ||
}; | ||
|
||
getAppStatus(); | ||
}, []); | ||
|
||
return ( | ||
<div className="App"> | ||
<header className="App-header"> | ||
<img src={logo} className="App-logo" alt="logo" /> | ||
<h1>App Status: {appStatus}</h1> | ||
<p> | ||
Edit <code>src/App.tsx</code> and save to reload. | ||
</p> | ||
<a | ||
className="App-link" | ||
href="https://reactjs.org" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
Learn React | ||
</a> | ||
</header> | ||
<InitialDataProvider> | ||
<Router /> | ||
</InitialDataProvider> | ||
</div> | ||
); | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
:root { | ||
--color-primary: #1677ff; | ||
--color-default: #555; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,18 @@ | ||
@import "./core/styles/variables.css"; | ||
|
||
html { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we can combine html, root, body common styles |
||
height: 100%; | ||
width: 100%; | ||
} | ||
|
||
#root { | ||
height: 100%; | ||
width: 100%; | ||
} | ||
|
||
body { | ||
height: 100%; | ||
width: 100%; | ||
margin: 0; | ||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', | ||
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', | ||
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
.footer { | ||
position: fixed; | ||
bottom: 0; | ||
width: 100%; | ||
padding: 20px 0; | ||
Nikkov17 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
border-top: 1px solid var(--color-primary); | ||
} | ||
|
||
.navigation { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
gap: 20px; | ||
} | ||
|
||
.nav-icon { | ||
font-size: 40px; | ||
Nikkov17 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
color: var(--color-default); | ||
} | ||
.nav-icon.active { | ||
color: var(--color-primary); | ||
} |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,37 @@ | ||||||
import { ShopOutlined, UserOutlined } from '@ant-design/icons'; | ||||||
import classNames from 'classnames/bind'; | ||||||
import { NavLink } from 'react-router-dom'; | ||||||
|
||||||
import { PROFILE_PAGE, RESTAURANTS_PAGE } from '../../../routes/pages'; | ||||||
import styles from './Footer.module.css'; | ||||||
|
||||||
const cx = classNames.bind(styles); | ||||||
|
||||||
interface FooterProps {} | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is it needed? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually no, until we will paste some page specific props to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So let's remove the dead code for now? |
||||||
|
||||||
const navItems = [ | ||||||
{ | ||||||
id: 'restaurants', | ||||||
to: RESTAURANTS_PAGE, | ||||||
icon: ShopOutlined, | ||||||
}, | ||||||
{ | ||||||
id: 'profile', | ||||||
to: PROFILE_PAGE, | ||||||
icon: UserOutlined, | ||||||
}, | ||||||
]; | ||||||
|
||||||
export const Footer = (_: FooterProps) => ( | ||||||
<footer className={cx('footer')}> | ||||||
<nav className={cx('navigation')}> | ||||||
{navItems.map(({ id, to, icon: Icon }) => ( | ||||||
<NavLink key={id} to={to}> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we use |
||||||
{({ isActive }) => ( | ||||||
<Icon className={cx('nav-icon', isActive ? 'active' : '')} /> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. More readable:
Suggested change
|
||||||
)} | ||||||
</NavLink> | ||||||
))} | ||||||
</nav> | ||||||
</footer> | ||||||
); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './Footer'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.profile-page { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would suggest removing all unused styles/code to not forget to do that in the future. UI looks absolutely the same without this file. |
||
display: flex; | ||
flex-direction: column; | ||
width: 100%; | ||
height: 100%; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import classNames from 'classnames/bind'; | ||
|
||
import { Footer } from '../common/footer'; | ||
import styles from './ProfilePage.module.css'; | ||
|
||
const cx = classNames.bind(styles); | ||
|
||
export const ProfilePage = () => ( | ||
<div className={cx('profile-page')}> | ||
<Footer /> | ||
</div> | ||
); |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would suggest not adding |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './ProfilePage'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
.restaurants-page { | ||
display: flex; | ||
flex-direction: column; | ||
width: 100%; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also |
||
height: 100%; | ||
} | ||
|
||
.current-city { | ||
display: flex; | ||
justify-content: center; | ||
padding: 10px 5px; | ||
} | ||
|
||
.current-city a { | ||
text-decoration: none; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { SearchOutlined } from '@ant-design/icons'; | ||
import Button from 'antd/lib/button'; | ||
import classNames from 'classnames/bind'; | ||
import { useContext } from 'react'; | ||
import { Link } from 'react-router-dom'; | ||
|
||
import { StoreContext } from '../../providers/store-provider'; | ||
import { SEARCH_PAGE } from '../../routes/pages'; | ||
import { Footer } from '../common/footer'; | ||
import { | ||
SEARCH_TYPE_CITIES, | ||
SEARCH_TYPE_RESTAURANTS, | ||
} from '../search-page/constants'; | ||
import { NoCityBlock } from './no-city-block'; | ||
import styles from './RestaurantsPage.module.css'; | ||
|
||
const cx = classNames.bind(styles); | ||
|
||
export const RestaurantsPage = () => { | ||
const { selectedCity } = useContext(StoreContext); | ||
|
||
return ( | ||
<div className={cx('restaurants-page')}> | ||
{selectedCity ? ( | ||
<> | ||
<span className={cx('current-city')}> | ||
<Link to={SEARCH_PAGE} state={{ type: SEARCH_TYPE_CITIES }}> | ||
{selectedCity} | ||
</Link> | ||
</span> | ||
<Link to={SEARCH_PAGE} state={{ type: SEARCH_TYPE_RESTAURANTS }}> | ||
<Button icon={<SearchOutlined />} size="large"> | ||
Restaurants | ||
</Button> | ||
</Link> | ||
{/* TODO: Restaurants list will be here */} | ||
</> | ||
) : ( | ||
<NoCityBlock /> | ||
)} | ||
<Footer /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should the footer be visible for all pages i.e. be placed in the App.tsx? like the main menu (in Wolt this is always visible) |
||
</div> | ||
); | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './RestaurantsPage'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.no-city-block { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
width: 100%; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please, remove |
||
height: calc(100% - 80px); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { SearchOutlined } from '@ant-design/icons'; | ||
import Button from 'antd/lib/button'; | ||
import classNames from 'classnames/bind'; | ||
import { Link } from 'react-router-dom'; | ||
|
||
import { SEARCH_PAGE } from '../../../routes/pages'; | ||
import { SEARCH_TYPE_CITIES } from '../../search-page/constants'; | ||
import styles from './NoCityBlock.module.css'; | ||
|
||
const cx = classNames.bind(styles); | ||
|
||
export const NoCityBlock = () => ( | ||
<div className={cx('no-city-block')}> | ||
<Link to={SEARCH_PAGE} state={{ type: SEARCH_TYPE_CITIES }}> | ||
<Button icon={<SearchOutlined />} size="large"> | ||
Choose City | ||
</Button> | ||
</Link> | ||
</div> | ||
); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './NoCityBlock'; |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,26 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
import { useLocation } from 'react-router-dom'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
import { SEARCH_TYPE_CITIES, SEARCH_TYPE_RESTAURANTS } from './constants'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
import { CitiesSearch, RestaurantsSearch } from './supported-searches'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// TODO: change to some fallback | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const EmptyComponent = () => <div />; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
export const SearchPage = () => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const { state: locationState } = useLocation(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
let SearchComponent = EmptyComponent; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
switch (locationState.type) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
case SEARCH_TYPE_CITIES: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
SearchComponent = CitiesSearch; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
break; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
case SEARCH_TYPE_RESTAURANTS: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
SearchComponent = RestaurantsSearch; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
break; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
default: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
break; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
return <SearchComponent />; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+1
to
+26
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,2 @@ | ||||||||||||||
export const SEARCH_TYPE_CITIES = 'cities'; | ||||||||||||||
export const SEARCH_TYPE_RESTAURANTS = 'restaurants'; | ||||||||||||||
Comment on lines
+1
to
+2
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
const MINSK = 'Minsk'; | ||
const TBILISI = 'Tbilisi'; | ||
const MOSCOW = 'Moscow'; | ||
const TASHKENT = 'Tashkent'; | ||
|
||
export const supportedCities = [MINSK, TBILISI, MOSCOW, TASHKENT]; | ||
|
||
export const restaurantsByCities: { [name: string]: string[] } = { | ||
[MINSK]: ['Vasilki', 'The View'], | ||
[TBILISI]: ['Tiflis', 'Mimino'], | ||
[MOSCOW]: ['Russkiy', 'Stolovaya'], | ||
[TASHKENT]: ['Chaikhana', 'Plov!'], | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './SearchPage'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.search-with-list { | ||
padding: 10px; | ||
} | ||
|
||
.entity-item { | ||
display: block; | ||
padding: 10px; | ||
text-decoration: none; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
really minor, but could you please make the step names consistent with the 1st action