-
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?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can combine html, root, body common styles
|
||
const cx = classNames.bind(styles); | ||
|
||
interface FooterProps {} |
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.
is it needed?
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.
Actually no, until we will paste some page specific props to Footer
.
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.
So let's remove the dead code for now?
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.
Please, change all file names to snake-case
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.
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.
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.
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
transform: rotate(360deg); | ||
} | ||
height: 100%; | ||
width: 100%; |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, use classes for styles
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not used outside, please remove export
.
The same for defaultStore
below
TODO (will be a part of another PR):