-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
db029b9
commit 2a34158
Showing
25 changed files
with
319 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,47 @@ | ||
import {useEffect} from "react"; | ||
import {connect} from "react-redux"; | ||
|
||
import {fetchDelivery} from "../../redux/actions/delivery"; | ||
|
||
import Logo from "../Logo"; | ||
import MainTab from "../MainTab"; | ||
import Footer from "../Footer"; | ||
|
||
import "./style.scss"; | ||
import DeliveryLoading from "../DeliveryLoading"; | ||
import DeliveryQuery from "../DeliveryQuery"; | ||
import DeliveryNotFound from "../DeliveryNotFound"; | ||
|
||
const App = ({delivery, fetchDelivery}) => { | ||
const deliveryToken = new URLSearchParams(window.location.search).get("token"); | ||
const orderNumber = new URLSearchParams(window.location.search).get("orderNumber"); | ||
|
||
useEffect(() => { | ||
if (deliveryToken) | ||
fetchDelivery("token", deliveryToken); | ||
else if (orderNumber) | ||
fetchDelivery("orderNumber", orderNumber); | ||
}, [deliveryToken, orderNumber, fetchDelivery]); | ||
|
||
const App = () => { | ||
return ( | ||
<div className="app"> | ||
<Logo/> | ||
<MainTab/> | ||
{(deliveryToken || orderNumber) && (delivery.fetching ? <DeliveryLoading/> : (delivery.error.status) ? | ||
<DeliveryNotFound/> : <MainTab/>)} | ||
<DeliveryQuery/> | ||
<Footer/> | ||
</div> | ||
); | ||
}; | ||
|
||
export default App; | ||
const mapStateToProps = (state) => { | ||
return { | ||
delivery: state.delivery | ||
}; | ||
}; | ||
|
||
const mapDispatchToProps = { | ||
fetchDelivery | ||
}; | ||
|
||
export default connect(mapStateToProps, mapDispatchToProps)(App); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import "./style.scss"; | ||
|
||
const DeliveryLoading = () => { | ||
return ( | ||
<div className="delivery-loading"> | ||
<div className="title">Gönderi Aranıyor...</div> | ||
<div className="spinner"></div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default DeliveryLoading; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
.delivery-loading { | ||
margin: 30px 0; | ||
padding: 20px; | ||
background-color: #fff; | ||
text-align: center; | ||
|
||
.title { | ||
color: #f16623; | ||
font-size: 24px; | ||
font-weight: 500; | ||
margin-bottom: 16px; | ||
} | ||
|
||
.spinner { | ||
display: inline-block; | ||
width: 60px; | ||
height: 60px; | ||
} | ||
|
||
.spinner:after { | ||
content: " "; | ||
display: block; | ||
width: 40px; | ||
height: 40px; | ||
margin: 8px; | ||
border-radius: 50%; | ||
border: 6px solid #f16623; | ||
border-color: #f16623 transparent #f16623 transparent; | ||
animation: spinner 1.2s linear infinite; | ||
} | ||
|
||
@keyframes spinner { | ||
0% { | ||
transform: rotate(0deg); | ||
} | ||
100% { | ||
transform: rotate(360deg); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import "./style.scss"; | ||
|
||
const DeliveryNotFound = () => { | ||
return ( | ||
<div className="delivery-not-found"> | ||
<div className="title"> | ||
Gönderi Bulunamadı! | ||
</div> | ||
<div className="content"> | ||
Verilen bilgiye ait gönderi bulunamamıştır. | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default DeliveryNotFound; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
.delivery-not-found { | ||
margin-top: 30px; | ||
padding: 20px; | ||
background-color: #fff; | ||
text-align: center; | ||
|
||
.title { | ||
color: #f16623; | ||
font-size: 24px; | ||
font-weight: 500; | ||
margin-bottom: 16px; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import {useState} from "react"; | ||
|
||
import "./style.scss"; | ||
|
||
const DeliveryQuery = () => { | ||
const [deliveryNo, setDeliveryNo] = useState(""); | ||
|
||
return ( | ||
<div className="delivery-query"> | ||
<form action="/" method="GET"> | ||
<div className="search-input"> | ||
<input | ||
type="text" | ||
name="orderNumber" | ||
placeholder="Teslimat Numarası Ile Sorgula" | ||
value={deliveryNo} | ||
onChange={(e) => setDeliveryNo(e.target.value)} | ||
/> | ||
<button | ||
type="submit" | ||
disabled={deliveryNo.length < 8 || isNaN(deliveryNo)} | ||
> | ||
Sorgula | ||
</button> | ||
</div> | ||
</form> | ||
</div> | ||
); | ||
}; | ||
|
||
export default DeliveryQuery; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,8 @@ | |
padding: 30px; | ||
background-color: #f4f7fa; | ||
border-radius: 20px; | ||
|
||
form { | ||
width: 100%; | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
src/components/DeliveryStatus/DeliveryMovements/DeliveryTable/TableItem/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import {getDateFromUnix} from "../../../../../helpers/getDate"; | ||
|
||
const TableItem = ({actionDate, operationalState, description, location}) => { | ||
let operationalStateText = { | ||
0: "Gönderi Alındı", | ||
1: "Gönderi", | ||
2: "Transfer Merkezinde", | ||
3: "Gönderi Yola Çıktı (Teslimat şubesine)", | ||
4: "Teslimat Şubesine Ulaştı", | ||
5: "Teslimat Şubesine Ulaştı", | ||
6: "Kurye Dağıtımda", | ||
7: "Teslim Edildi", | ||
8: "Gönderi", | ||
9: "Gönderi", | ||
10: "Gönderi", | ||
11: "Gönderi Yola Çıktı (Transfer merkezine)" | ||
}; | ||
|
||
|
||
return ( | ||
<ul className="table-body"> | ||
<li>{getDateFromUnix(actionDate)}</li> | ||
<li>{operationalStateText[operationalState]}</li> | ||
<li>{description}</li> | ||
<li>{location}</li> | ||
</ul> | ||
); | ||
}; | ||
|
||
export default TableItem; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.