-
-
Notifications
You must be signed in to change notification settings - Fork 542
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
9545c6b
commit db0f7c7
Showing
11 changed files
with
8,761 additions
and
5,448 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
File renamed without changes.
File renamed without changes.
41 changes: 41 additions & 0 deletions
41
src/app/[countryCode]/(main)/order/[id]/transfer/[token]/accept/page.tsx
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,41 @@ | ||
import { acceptTransferRequest } from "@lib/data/orders" | ||
import { Heading, Text } from "@medusajs/ui" | ||
import TransferImage from "@modules/order/components/transfer-image" | ||
|
||
export default async function TransferPage({ | ||
params, | ||
}: { | ||
params: { id: string; token: string } | ||
}) { | ||
const { id, token } = params | ||
|
||
const { success, error } = await acceptTransferRequest(id, token) | ||
|
||
return ( | ||
<div className="flex flex-col gap-y-4 items-start w-3/5 mx-auto mt-10 mb-20"> | ||
<TransferImage /> | ||
<div className="flex flex-col gap-y-6"> | ||
{success && ( | ||
<> | ||
<Heading level="h1" className="text-xl text-zinc-900"> | ||
Order transfered! | ||
</Heading> | ||
<Text className="text-zinc-600"> | ||
Order {id} has been successfully transfered to the new owner. | ||
</Text> | ||
</> | ||
)} | ||
{!success && ( | ||
<> | ||
<Text className="text-zinc-600"> | ||
There was an error accepting the transfer. Please try again. | ||
</Text> | ||
{error && ( | ||
<Text className="text-red-500">Error message: {error}</Text> | ||
)} | ||
</> | ||
)} | ||
</div> | ||
</div> | ||
) | ||
} |
41 changes: 41 additions & 0 deletions
41
src/app/[countryCode]/(main)/order/[id]/transfer/[token]/decline/page.tsx
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,41 @@ | ||
import { declineTransferRequest } from "@lib/data/orders" | ||
import { Heading, Text } from "@medusajs/ui" | ||
import TransferImage from "@modules/order/components/transfer-image" | ||
|
||
export default async function TransferPage({ | ||
params, | ||
}: { | ||
params: { id: string; token: string } | ||
}) { | ||
const { id, token } = params | ||
|
||
const { success, error } = await declineTransferRequest(id, token) | ||
|
||
return ( | ||
<div className="flex flex-col gap-y-4 items-start w-3/5 mx-auto mt-10 mb-20"> | ||
<TransferImage /> | ||
<div className="flex flex-col gap-y-6"> | ||
{success && ( | ||
<> | ||
<Heading level="h1" className="text-xl text-zinc-900"> | ||
Order transfer declined! | ||
</Heading> | ||
<Text className="text-zinc-600"> | ||
Transfer of order {id} has been successfully declined. | ||
</Text> | ||
</> | ||
)} | ||
{!success && ( | ||
<> | ||
<Text className="text-zinc-600"> | ||
There was an error declining the transfer. Please try again. | ||
</Text> | ||
{error && ( | ||
<Text className="text-red-500">Error message: {error}</Text> | ||
)} | ||
</> | ||
)} | ||
</div> | ||
</div> | ||
) | ||
} |
51 changes: 51 additions & 0 deletions
51
src/app/[countryCode]/(main)/order/[id]/transfer/[token]/page.tsx
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,51 @@ | ||
import { Button, Heading, Text } from "@medusajs/ui" | ||
import LocalizedClientLink from "@modules/common/components/localized-client-link" | ||
import TransferImage from "@modules/order/components/transfer-image" | ||
|
||
export default async function TransferPage({ | ||
params, | ||
}: { | ||
params: { id: string; token: string } | ||
}) { | ||
const { id, token } = params | ||
|
||
return ( | ||
<div className="flex flex-col gap-y-4 items-start w-3/5 mx-auto mt-10 mb-20"> | ||
<TransferImage /> | ||
<div className="flex flex-col gap-y-6"> | ||
<Heading level="h1" className="text-xl text-zinc-900"> | ||
Transfer request for order {id} | ||
</Heading> | ||
<Text className="text-zinc-600"> | ||
You've received a request to transfer ownership of your order ({id}). | ||
If you agree to this request, you can approve the transfer by clicking | ||
the button below. | ||
</Text> | ||
<div className="w-full h-px bg-zinc-200" /> | ||
<Text className="text-zinc-600"> | ||
If you accept, the new owner will take over all responsibilities and | ||
permissions associated with this order. | ||
</Text> | ||
<Text className="text-zinc-600"> | ||
If you do not recognize this request or wish to retain ownership, no | ||
further action is required. | ||
</Text> | ||
<div className="w-full h-px bg-zinc-200" /> | ||
<div className="flex gap-x-4"> | ||
<Button size="large" asChild> | ||
<LocalizedClientLink href={`/order/${id}/transfer/${token}/accept`}> | ||
Approve transfer | ||
</LocalizedClientLink> | ||
</Button> | ||
<Button size="large" variant="secondary" asChild> | ||
<LocalizedClientLink | ||
href={`/order/${id}/transfer/${token}/decline`} | ||
> | ||
Decline transfer | ||
</LocalizedClientLink> | ||
</Button> | ||
</div> | ||
</div> | ||
</div> | ||
) | ||
} |
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
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.