Skip to content

Commit

Permalink
Merge pull request #127 from ensocean/test
Browse files Browse the repository at this point in the history
Test
  • Loading branch information
rdonmez authored Jan 2, 2023
2 parents e8b70b9 + cdb6e76 commit 2eecbcf
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 29 deletions.
16 changes: 10 additions & 6 deletions src/components/AutoComplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,27 +166,31 @@ const AutoComplete = () => {
<Menu {...menuProps} >
{domains.map((domain, index) => (
<div key={domain.id}>
<div className="d-flex flex-column justify-content-between p-0 ps-2 pe-3 pt-2 pb-2">
<div className="d-flex flex-column justify-content-between p-0 ps-2 pe-3 pt-2 pb-2 gap-2">
<div className="d-flex flex-row justify-content-between gap-2 ms-2 text-truncate placeholder-glow">
<DomainLink domain={domain} />
<div className='d-flex flex-row justify-content-center gap-2'>
{loading && <Spinner animation="border" variant="dark" size="sm" /> }
{!loading && <DomainStatus domain={domain} showBadge={true} showNotAvailable={true} />}
{!loading && !domain.available && <><AddToWatchlistSmallButton domain={domain} /> </>}

</div>
</div>
{!loading && !domain.available &&
<div className="d-flex flex-row justify-content-between gap-2 ms-2 text-truncate placeholder-glow">
<DomainStatus domain={domain} showBadge={true} showNotAvailable={false} showAvailable={false} showGracePeriod={false} showPremium={false} showExpires={true} showInvalid={false} />
{!loading && !domain.available && <><AddToWatchlistSmallButton domain={domain} /> </>}
</div>
}

</div>
{!loading && domain.available === true &&
<div className="d-flex flex-row justify-content-center align-items-center gap-2">
<AddToCartButton domain={domain} />
<ClaimNowButton domain={domain} />
<ViewYourCartButton domain={domain} />
<div className="d-flex flex-row justify-content-between align-items-center ps-3 pe-3 pt-2 pb-2 gap-2">
<div className='d-flex flex-row gap-2'>
<AddToCartButton domain={domain} />
<ClaimNowButton domain={domain} />
<ViewYourCartButton domain={domain} />
</div>
{!loading && <><AddToWatchlistSmallButton domain={domain} /> </>}
</div>
}
</div>
Expand Down
44 changes: 23 additions & 21 deletions src/pages/Find.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { Search } from "react-bootstrap-icons";
import { Col, Container, Form, InputGroup, Row, Spinner } from "react-bootstrap";
import { DelayInput } from "react-delay-input";
import { GET_DOMAINS } from "../graphql/Queries";
import AddToWatchlistSmallButton from "../components/AddToWatchlistSmallButton";

const Find = () => {
const location = useLocation();
Expand Down Expand Up @@ -152,42 +153,43 @@ const Find = () => {
</Col>
</Row>
<Row>
<Col className="pt-3 text-center">
<Col className="pt-3">
{error && <span className="text-danger">There was an error. Please try again.</span>}
{!query && <span className="text-muted text-center fs-6 fw-bold">Type 3 charcters or more to search.</span>}
{!loading && query && options && options.length > 0 &&
<>
{!isAvailable(options[0].expires) &&
<div className="d-flex flex-column align-items-center">
<div className="d-flex flex-column justify-content-between align-items-center gap-2">
<span className="text-muted fs-4 fw-bold">
<div className="d-flex flex-column justify-content-center gap-2 p-2">
<div className="d-flex flex-row justify-content-between align-items-start gap-2">
<span className="text-muted fs-4 fw-bold text-truncate">
{options[0].label}.{options[0].extension} is not available 😭
</span>
<span className="text-muted fw-bold">
Expires {getTimeAgo(options[0].expires)}
</span>
<div className="text-muted fs-6 text-center">
This name was last registered on {getDateString(options[0].registered)}
</div>
</span>
</div>
<div className="d-flex flex-row justify-content-between gap-2">
<span className="text-muted">
Expires {getTimeAgo(options[0].expires)}
</span>
<AddToWatchlistSmallButton domain={options[0]} />
</div>
</div>
}
{isAvailable(options[0].expires) &&
<>
<div className="d-flex flex-row align-items-center justify-content-center">
<div className="d-flex flex-column justify-content-between align-items-center gap-2">
<span className="text-success fs-4 fw-bold">
<div className="d-flex flex-column flex-md-row justify-content-between align-items-center gap-2 p-2">
<div className="d-flex flex-row justify-content-center align-items-center gap-2 text-truncate">
<span className="text-success fs-4 fw-bold text-truncate">
{options[0].label}.{options[0].extension} is available 🥳
</span>
<span className="text-muted fs-4 fw-bold">
</span>
</div>
</div>
<div className="d-flex flex-row justify-content-center gap-3 mt-3">
<AddToCartButton domain={options[0]} />
{!inRegisterlist(options[0].id) && <ClaimNowButton domain={options[0]} />}
{inRegisterlist(options[0].id) && <ViewYourCartButton domain={options[0]} />}
</div>
<div className="d-flex flex-row justify-content-between align-items-center gap-2 p-2">
<div className="d-flex flex-row gap-2">
<AddToCartButton domain={options[0]} />
{!inRegisterlist(options[0].id) && <ClaimNowButton domain={options[0]} />}
{inRegisterlist(options[0].id) && <ViewYourCartButton domain={options[0]} />}
</div>
<AddToWatchlistSmallButton domain={options[0]} />
</div>
</>
}
</>
Expand Down
4 changes: 2 additions & 2 deletions src/pages/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ const Home = () => {
<Col className="mb-1 d-block d-lg-none" lg>
<AutoComplete />
</Col>
<Col>
<Col lg>
<RecentExpired />
</Col>
<Col>
<Col lg>
<RecentRegistered />
</Col>
</Row>
Expand Down

0 comments on commit 2eecbcf

Please sign in to comment.