polymorpher / otc-country

0 stars 0 forks source link

Showing offer based on SLD #17

Open polymorpher opened 1 month ago

polymorpher commented 1 month ago

On landing page, the system should extract the SLD (e.g. polymorpher from polymorpher.country), find out the offer address (through OTC contract), then interact with the offer contract at that address and show details of the offer. If it turns out that no offer contract exists at that address, the page should show appropriate error message.

The route /offer/:address should only be used for debugging purposes. All links to individual offers should be pointing to <domainName>.<TLD> (where TLD=country) by default

polymorpher commented 1 month ago

Helper functions:

https://github.com/polymorpher/dot-country-embedder/blob/c3e6056741c755ae963b6f3c77922b1c0f3985b2/client/src/utils.ts#L6

0xvgd commented 1 month ago

Extract the SLD from what? Landing page doesn't have domain input.

polymorpher commented 1 month ago

From URL, people use domain to visit offers, e.g. polymorpher.country, not https://..../offers/0x....

0xvgd commented 1 month ago

I understand, but you were talking about landing page, not offer page 🤣 So is this issue for page https://.../offers/[domain]?

polymorpher commented 1 month ago

The landing page is the offer page, when URL hostname is not otc.country. See https://github.com/polymorpher/dot-country-embedder/blob/main/client/src/AppRoutes.tsx for example. i.e. / (or unmatched /*) should be routed to the offer component. The route /offers/<address> can also be routed to offer component but should only be used for debugging