-
Notifications
You must be signed in to change notification settings - Fork 288
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
feat(#488): Area ve location requestlerinin ayrilmasi #533
Conversation
…it from the response
…n't get it from the response" This reverts commit fe1f4bc.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
pt: "4px", | ||
}} | ||
> | ||
{data?.baseMarker?.formatted_address} |
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.
Bunu gosteremiyoruz cunku artik formatted_address
i areas-lite
dan almiyoruz
Biraz error handling ekliyorum.. |
@altankurt #488 ve #521 ayni isler (ya da cok benzer) |
<Button | ||
variant="outlined" | ||
className={styles.clipboard} | ||
{isLoading && ( |
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.
Aslinda SWR icin da global loading handler implement edilebiliyor ama ayri bir is: vercel/swr#942 (comment)
components/UI/Drawer/Drawer.tsx
Outdated
{error && ( | ||
<Box | ||
sx={{ | ||
height: "300px", |
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.
Buraya fixed bir height vermeden cozmenin bir yolu var mi?
(Bunu vermezsek asagidan cilar drawer loading indicator heighti kadar oluyor)
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.
Error component'ini component/Error altinda generic hale getirsek daha kullanisli olabilir.
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.
Fixed height yerine responsive min height ayarlamak daha esnek olur.
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.
SkeletonLoader koyabiliriz ama onlara da fixed bir height vermek gerekir.
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.
Aslinda bu error componenti cok genericmis. Butun return kismi suna donusse aslinda cok guzel olur bence:
if (error) return <Error />;
if (isLoading) return <Spinner />
if (!data) return <Empty />
return (...)
error componentini minHeight ile istedigimiz gibi kullanabiliriz.
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.
@buraksaraloglu Katiliyorum, bence butun Drawer'in refactor edilmesi lazim. Baska bir PR'da yapsak olur mu?
components/UI/Drawer/Drawer.tsx
Outdated
}} | ||
> | ||
<Typography variant="h5"> | ||
Teknik bir sorun oluştu. Lütfen daha sonra tekrar deneyiniz. |
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.
Generic bir sey ekledim, tavsiyelere acigim.
</Typography> | ||
</Box> | ||
)} | ||
{!isLoading && data && ( |
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.
Buradan sonrasi ayni kod, herhangi bir sey eklemedim. Sadece useMemo
nun dependency arrayine isLoading
ve error
ekledim.
utils/constants.ts
Outdated
@@ -1,3 +1,3 @@ | |||
export const BASE_URL = "https://apigo.afetharita.com/feeds/areas"; | |||
export const BASE_URL = "https://api.afetharita.com"; |
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.
TODO: backendden haber geldiginde URL'i degistirebiliriz.
components/UI/Drawer/Drawer.tsx
Outdated
{error && ( | ||
<Box | ||
sx={{ | ||
height: "300px", |
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.
Error component'ini component/Error altinda generic hale getirsek daha kullanisli olabilir.
components/UI/Drawer/Drawer.tsx
Outdated
{error && ( | ||
<Box | ||
sx={{ | ||
height: "300px", |
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.
Fixed height yerine responsive min height ayarlamak daha esnek olur.
components/UI/Drawer/Drawer.tsx
Outdated
); | ||
|
||
useEffect(() => { | ||
if (isOpen) { |
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.
Butun fonksiyonu if ile sarmalamak yerine useEffect'in basinda if (!isOpen) return;
diyerek okunabilirligi arttirabilirsin.
components/UI/Drawer/Drawer.tsx
Outdated
<Typography>{raw?.full_text}</Typography> | ||
</div> | ||
)} | ||
{!showSavedData && ( |
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.
266 satir ile bu satiri neden ayri ayri kontrol ediyoruz? ? :
yeterli olmasi lazim.
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.
Bilmiyorum ama fix ettim 👍
Açıklama
Bu PR yaptigimiz tek requesti, 2 farkli request olacak sekilde refactor ediyor.
areas-lite
icerisinde sadece id, lat, lng aliyoruz.Geri kalan detay verileri ise drawer acildiginda
locations/{locationId}
ile aliyoruz.discord kullanıcı adı: @canerdagli
Closes #488 and possibly #521
Loading:
Error:
Lütfen değişikliklerinizi açıklayın. Aynı zamanda amacınızı ve içeriği açıklayın. Bu değişikliklerin gerektirdiği bağımlılıkları da listelemeyi unutmayın.
## PR açmadan önce dikkat edilmesi gerekenler
PR açma kuralları
Değişiklikler
Bu değişiklikler nasıl test edildi?
Lütfen yaptığınız değişiklikleri test etmek için yaptığınız testleri açıklayın. Lütfen aynı zamanda test konfigürasyonunuzu da belirtin.
Test Konfigürasyonu: