Create basic app structure. Add deploy-dev pipeline#7
Create basic app structure. Add deploy-dev pipeline#7
Conversation
2558b52 to
27c88c9
Compare
2a7ce59 to
32bc5a0
Compare
* feat: add telegram token validation * feat: fix comments * feat: telegram token validation fix comments * Added tsconfig build to not block development. --------- Co-authored-by: Roman Sluka <r.sluka@itransition.com>
75a030e to
7db6e85
Compare
|
@Nikkov17 @skyRoma |
| @@ -1,4 +1,18 @@ | |||
| @import "./core/styles/variables.css"; | |||
|
|
|||
| html { | |||
There was a problem hiding this comment.
we can combine html, root, body common styles
|
|
||
| const cx = classNames.bind(styles); | ||
|
|
||
| interface FooterProps {} |
There was a problem hiding this comment.
Actually no, until we will paste some page specific props to Footer.
There was a problem hiding this comment.
So let's remove the dead code for now?
There was a problem hiding this comment.
Please, change all file names to snake-case
There was a problem hiding this comment.
As we agreed before or let's agree this CapitalCamelCase approach just for component file names. Both cases work for me, but they should be consistent across the whole project.
| with: | ||
| node-version: 18 | ||
|
|
||
| - name: Configure git profile |
| transform: rotate(360deg); | ||
| } | ||
| height: 100%; | ||
| width: 100%; |
There was a problem hiding this comment.
Width is 100% by default, sicne it's a <div>, so please remove this prop
| children, | ||
| }: IInitialDataProviderProps) => { | ||
| // TODO: Use city from Telegram | ||
| const extractCity = (): string => |
There was a problem hiding this comment.
it everytime will be null for the first visit, so use :string | null and remove as string below.
Or use localStorage.getItem(LOCAL_STORAGE_SAVED_CITY_KEY) || ''
| placeholder="Input search text" | ||
| allowClear | ||
| onChange={onChange} | ||
| style={{ width: '100%' }} |
There was a problem hiding this comment.
As I can see it is even 100% by default
| entities?: string[]; | ||
| onChange: (event: ChangeEvent<HTMLInputElement>) => void; | ||
| onEntityClick?: (entityName: string) => void; | ||
| entityLinkTarget: string; |
There was a problem hiding this comment.
Should this also be an optional property? I suppose you wanted to make this component reusable even without list, just with input? But in general, I would suggest using composition in such cases (to have 2 separate components, search and list). But as for now we don't need just search (without list) let's make all properties required
There was a problem hiding this comment.
And please group them together (first fields then methods). And for the future lets place the optional ones below the required ones
| export const RestaurantsSearch = () => { | ||
| const { selectedCity } = useContext(StoreContext); | ||
| const [restaurants, setRestaurants] = useState<string[]>( | ||
| restaurantsByCities[selectedCity] || [] |
There was a problem hiding this comment.
I suppose we won't have a city in the App if we don't have any restaurant for this city so you can remove || []
There was a problem hiding this comment.
Sorry, but I didn't get why do we need this additional provider? why not just use only one StoreProvider? For me it looks unnecessary completed
like this for example
import { LOCAL_STORAGE_SAVED_CITY_KEY } from 'providers/store-provider/constants';
import { ReactElement, useCallback, useState } from 'react';
import {
IStoreContext,
StoreContext,
StoreDispatchContext,
} from './storeContext';
interface IStoreProviderProps {
children: ReactElement;
}
const extractCity = (): string =>
localStorage.getItem(LOCAL_STORAGE_SAVED_CITY_KEY) || '';
const saveCityLocally = ({ selectedCity }: Partial<IStoreContext>) => {
localStorage.setItem(LOCAL_STORAGE_SAVED_CITY_KEY, String(selectedCity));
};
const initialStore = {
selectedCity: extractCity(),
};
export const StoreProvider = ({ children }: IStoreProviderProps) => {
const [store, setStore] = useState(initialStore);
const updateStoreProperties = useCallback(
(storeProperties: Partial<IStoreContext>) => {
setStore(prevStore => ({
...prevStore,
...storeProperties,
}));
saveCityLocally(storeProperties);
},
[]
);
return (
<StoreContext.Provider value={store}>
<StoreDispatchContext.Provider value={updateStoreProperties}>
{children}
</StoreDispatchContext.Provider>
</StoreContext.Provider>
);
};| selectedCity: string; | ||
| } | ||
|
|
||
| export type StoreDispatchType = (storeProperty: Partial<IStoreContext>) => void; |
There was a problem hiding this comment.
This is not used outside, please remove export.
The same for defaultStore below



TODO (will be a part of another PR):