All files / app/features/landing LandingPage.tsx

0% Statements 0/39
0% Branches 0/7
0% Functions 0/6
0% Lines 0/37

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
import {
  Button as MuiButton,
  Container,
  Divider,
  Grid,
  IconButton,
  Paper,
  Typography,
} from "@material-ui/core";
import classNames from "classnames";
import Button from "components/Button";
import HtmlMeta from "components/HtmlMeta";
import { ExpandMoreIcon } from "components/Icons";
import StyledLink from "components/StyledLink";
import { useAuthContext } from "features/auth/AuthProvider";
import BasicForm from "features/auth/signup/BasicForm";
import useAuthStyles from "features/auth/useAuthStyles";
import { AUTH, GLOBAL, LANDING } from "i18n/namespaces";
import Link from "next/link";
import { useRouter } from "next/router";
import { Trans, useTranslation } from "next-i18next";
import { useEffect, useRef, useState } from "react";
import { useQueryClient } from "react-query";
import vercelLogo from "resources/vercel.svg";
import makeStyles from "utils/makeStyles";
 
import {
  blogRoute,
  forumURL,
  loginRoute,
  signupRoute,
  tosRoute,
  volunteerRoute,
} from "../../routes";
 
const useStyles = makeStyles((theme) => ({
  scrollMoreButton: {
    color: theme.palette.common.white,
    background: "none",
    border: "none",
  },
  spacer: {
    height: theme.spacing(4),
  },
  topSection: {
    padding: theme.spacing(3),
  },
  header: {
    fontSize: "2rem",
    fontWeight: "bold",
    marginBottom: theme.spacing(3),
  },
  para: {
    marginBottom: theme.spacing(2),
  },
  subNavButtons: {
    marginRight: theme.spacing(2),
  },
  continueButton: {
    margin: theme.spacing(4, 0),
  },
  tileSection: {
    padding: theme.spacing(3),
    paddingTop: 0,
  },
  tile: {
    color: "#fff",
    height: "100%",
    padding: theme.spacing(3),
    margin: "auto",
    maxWidth: "80vw",
  },
  governanceTile: {
    backgroundColor: "#82bb42",
  },
  designTile: {
    backgroundColor: "#3da4ab",
  },
  techTile: {
    backgroundColor: "#f46d50",
  },
  topicLink: {
    textDecoration: "underline",
    paddingTop: theme.spacing(2),
  },
}));
 
export default function LandingPage() {
  const { t } = useTranslation([GLOBAL, LANDING, AUTH]);
  const { authState } = useAuthContext();
  const flowState = authState.flowState;
 
  const router = useRouter();
 
  const authClasses = useAuthStyles();
  const classes = useStyles();
 
  const [isMounted, setIsMounted] = useState(false);
  useEffect(() => setIsMounted(true), []);
 
  // This makes sure anything didn't get cleared up in the query cache in the Logout
  // component definitely gets cleared here when redirected to the landing page
  const queryClient = useQueryClient();
  useEffect(() => {
    Iif (!authState.authenticated) {
      queryClient.clear();
    }
  }, [queryClient, authState.authenticated]);
 
  const moreContentRef = useRef<HTMLHeadingElement>(null);
  const scrollToMore = () => {
    moreContentRef.current?.scrollIntoView({
      behavior: "smooth",
      block: "center",
    });
  };
 
  return (
    <>
      <HtmlMeta />
      <section
        className={classNames(
          classes.topSection,
          authClasses.page,
          authClasses.pageBackground
        )}
      >
        <div className={authClasses.content}>
          <div className={authClasses.introduction}>
            <Typography
              classes={{ root: authClasses.title }}
              variant="h1"
              component="h1"
            >
              {t("landing:introduction_title")}
            </Typography>
            <Typography
              classes={{ root: authClasses.subtitle }}
              variant="h2"
              component="span"
            >
              {t("landing:introduction_subtitle")}
              <Divider className={authClasses.underline}></Divider>
            </Typography>
          </div>
          <div className={authClasses.formWrapper}>
            <Typography variant="h2" component="h3">
              {t("landing:signup_header")}
            </Typography>
            <Typography variant="body2" paragraph gutterBottom>
              {t("landing:signup_description", { user_count: "40k" })}
            </Typography>
            {!flowState || !isMounted ? (
              <BasicForm
                submitText={t("landing:create_an_account")}
                successCallback={() => router.push(signupRoute)}
              />
            ) : (
              <Link href={signupRoute} passHref>
                <Button
                  variant="contained"
                  color="secondary"
                  className={classes.continueButton}
                >
                  {t("landing:signup_continue")}
                </Button>
              </Link>
            )}
            <Typography gutterBottom>
              <Trans i18nKey="auth:basic_sign_up_form.existing_user_prompt">
                Already have an account?{" "}
                <StyledLink href={loginRoute}>Log in</StyledLink>
              </Trans>
            </Typography>
            <Typography variant="caption" gutterBottom>
              <Trans i18nKey="auth:basic_sign_up_form.sign_up_agreement_explainer">
                By continuing, you agree to our{" "}
                <StyledLink href={tosRoute} target="_blank" variant="caption">
                  Terms of Service
                </StyledLink>
                , including our cookie, email, and data handling policies.
              </Trans>
            </Typography>
          </div>
        </div>
        {process.env.NEXT_PUBLIC_COUCHERS_ENV !== "prod" && (
          <a
            className={authClasses.vercelLink}
            rel="noopener noreferrer"
            href="https://vercel.com?utm_source=couchers-org&utm_campaign=oss"
          >
            <img alt="Powered by Vercel" src={vercelLogo.src} />
          </a>
        )}
        <MuiButton
          className={classes.scrollMoreButton}
          onClick={scrollToMore}
          variant="text"
        >
          Read more
        </MuiButton>
        <IconButton
          className={classes.scrollMoreButton}
          onClick={scrollToMore}
          size="small"
        >
          <ExpandMoreIcon />
        </IconButton>
      </section>
      <div className={classes.spacer} />
      <Container component="section" maxWidth="md">
        <Typography
          component="h2"
          className={classes.header}
          ref={moreContentRef}
        >
          Like Couchsurfing™, but better
        </Typography>
        <Typography className={classes.para}>
          Couchers.org is a <strong>non-profit and free</strong> platform,{" "}
          <strong>built by volunteers</strong> and responsible to the couch
          surfing community, instead of investors. Formed after
          Couchsurfing&#8482; put up its paywall in 2020, our goal is to{" "}
          <strong>reclaim couch surfing</strong> by creating a{" "}
          <strong>complete alternative</strong>, with all your{" "}
          <strong>favourite features</strong>.
        </Typography>
        <Typography className={classes.para}>
          Couchers.org is the <strong>fastest growing</strong> couch surfing
          platform. We have built the{" "}
          <strong>largest active volunteer base </strong> with over 40 skilled
          contributors. Our product teams are designing and developing the
          platform at blazing speed, releasing{" "}
          <strong>new features every two weeks</strong>; our community teams are
          planning out and executing user base growth and engagement strategies
          to reach a <strong>critical mass of quality couch surfers</strong>{" "}
          with active local communities and a vibrant global discussion.
        </Typography>
        <Typography className={classes.para}>
          <Link href={volunteerRoute} passHref>
            <Button
              variant="contained"
              color="secondary"
              className={classes.subNavButtons}
            >
              Join our team
            </Button>
          </Link>
          <Link href={volunteerRoute} passHref>
            <Button className={classes.subNavButtons}>Volunteer</Button>
          </Link>
        </Typography>
      </Container>
      <div className={classes.spacer} />
      <Container component="section" maxWidth="md">
        <Typography component="h2" className={classes.header}>
          Our plan: fix the problems with Couchsurfing™
        </Typography>
        <Typography className={classes.para}>
          We're sure that you, like all of us, have had great experiences that
          couldn't have happened without Couchsurfing™. But we all know it's got
          its issues. For the next generation in couch surfing apps, we need to
          fix those issues.
        </Typography>
        <Typography className={classes.para}>
          If there's any problems you've found with Couchsurfing™ or any other
          platforms, we'd love to hear about it so we can try to fix them.
        </Typography>
        <Typography className={classes.para}>
          <Link href={forumURL} passHref>
            <Button
              variant="contained"
              color="secondary"
              className={classes.subNavButtons}
            >
              Tell us what you think
            </Button>
          </Link>
        </Typography>
      </Container>
      <div className={classes.spacer} />
      <Container component="section" maxWidth="md">
        <Typography component="h2" className={classes.header}>
          The problems with Couchsurfing™
        </Typography>
      </Container>
      <Container
        component="section"
        maxWidth="lg"
        className={classes.tileSection}
      >
        <Grid
          container
          spacing={3}
          justifyContent="center"
          alignItems="stretch"
        >
          <Grid item xs={12} md={4}>
            <Paper className={classNames(classes.tile, classes.governanceTile)}>
              <Typography variant="subtitle1">Issue:</Typography>
              <Typography
                variant="h1"
                component="h3"
                className={classes.header}
              >
                Governance
              </Typography>
              <Typography
                variant="h2"
                component="h3"
                className={classes.topicLink}
              >
                <Link href="/issues/profit-and-incentives">
                  Profit incentives
                </Link>
              </Typography>
              <Typography variant="body1">
                Couchsurfing&#8482; is explicitly for-profit, prioritizing
                returns for investors over users and communities.
              </Typography>
 
              <Typography
                variant="h2"
                component="h3"
                className={classes.topicLink}
              >
                <Link href="/issues/communities-and-trust">
                  Neglected communities
                </Link>
              </Typography>
              <Typography variant="body1">
                The community has been ignored, too many users have been pushed
                onto the platform, trust between members has been eroded.
              </Typography>
            </Paper>
          </Grid>
          <Grid item xs={12} md={4}>
            <Paper className={classNames(classes.tile, classes.designTile)}>
              <Typography variant="subtitle1">Issue:</Typography>
              <Typography
                variant="h1"
                component="h3"
                className={classes.header}
              >
                Design
              </Typography>
              <Typography
                variant="h2"
                component="h3"
                className={classes.topicLink}
              >
                <Link href="/issues/creeps-and-freeloaders">Safety</Link>
              </Typography>
              <Typography variant="body1">
                Detrimental users threaten users' safety, especially for women.
                Freeloaders abound.
              </Typography>
 
              <Typography
                variant="h2"
                component="h3"
                className={classes.topicLink}
              >
                <Link href="/issues/reviews">Reference system</Link>
              </Typography>
              <Typography variant="body1">
                You can't trust people based on references.
              </Typography>
 
              <Typography
                variant="h2"
                component="h3"
                className={classes.topicLink}
              >
                <Link href="/issues/host-matching">Super-host effect</Link>
              </Typography>
              <Typography variant="body1">
                Local communities have been shrinking to just small groups of
                super-hosts.
              </Typography>
            </Paper>
          </Grid>
          <Grid item xs={12} md={4}>
            <Paper className={classNames(classes.tile, classes.techTile)}>
              <Typography variant="subtitle1">Issue:</Typography>
              <Typography
                variant="h1"
                component="h3"
                className={classes.header}
              >
                Technology
              </Typography>
              <Typography
                variant="h2"
                component="h3"
                className={classes.topicLink}
              >
                <Link href="/issues/the-build">The bugs and app issues</Link>
              </Typography>
              <Typography variant="body1">
                There are far too many bugs and problems with the
                Couchsurfing&#8482; platform. It wasn't good enough as a free
                service, and it's definitely not good enough now that it's paid.
              </Typography>
            </Paper>
          </Grid>
        </Grid>
      </Container>
      <div className={classes.spacer} />
      <Container component="section" maxWidth="md">
        <Typography component="h2" className={classes.header}>
          Our plan for the next-generation couch surfing platform
        </Typography>
      </Container>
      <Container
        component="section"
        maxWidth="lg"
        className={classes.tileSection}
      >
        <Grid
          container
          spacing={3}
          justifyContent="center"
          alignItems="stretch"
        >
          <Grid item xs={12} md={4}>
            <Paper className={classNames(classes.tile, classes.governanceTile)}>
              <Typography variant="subtitle1">Our plan:</Typography>
              <Typography
                variant="h1"
                component="h3"
                className={classes.header}
              >
                Governance
              </Typography>
              <Typography
                variant="h2"
                component="h3"
                className={classes.topicLink}
              >
                <Link href="/plan/profit-and-incentives">
                  Non-profit structure
                </Link>
              </Typography>
              <Typography variant="body1">
                This platform will be run as a non-profit, taking no outside
                investment. The priorities will be the users and community.
              </Typography>
 
              <Typography
                variant="h2"
                component="h3"
                className={classes.topicLink}
              >
                <Link href="/plan/communities-and-trust">
                  Community-first framework
                </Link>
              </Typography>
              <Typography variant="body1">
                We will build communities into the foundations of the product,
                and improve trust through a new verification method.
              </Typography>
            </Paper>
          </Grid>
          <Grid item xs={12} md={4}>
            <Paper className={classNames(classes.tile, classes.designTile)}>
              <Typography variant="subtitle1">Our plan:</Typography>
              <Typography
                variant="h1"
                component="h3"
                className={classes.header}
              >
                Design
              </Typography>
              <Typography
                variant="h2"
                component="h3"
                className={classes.topicLink}
              >
                <Link href="/plan/creeps-and-freeloaders">
                  Member accountability
                </Link>
              </Typography>
              <Typography variant="body1">
                Users will be accountable for how they treat other members,
                filtering out creeps and freeloaders.
              </Typography>
 
              <Typography
                variant="h2"
                component="h3"
                className={classes.topicLink}
              >
                <Link href="/plan/reviews">Improved review system</Link>
              </Typography>
              <Typography variant="body1">
                Overhauled references to reflect more accurately on users.
              </Typography>
 
              <Typography
                variant="h2"
                component="h3"
                className={classes.topicLink}
              >
                <Link href="/plan/host-matching">Better host finding</Link>
              </Typography>
              <Typography variant="body1">
                Healthier communities by spreading out hosting opportunities and
                no message limits.
              </Typography>
            </Paper>
          </Grid>
          <Grid item xs={12} md={4}>
            <Paper className={classNames(classes.tile, classes.techTile)}>
              <Typography variant="subtitle1">Our plan:</Typography>
              <Typography
                variant="h1"
                component="h3"
                className={classes.header}
              >
                Technology
              </Typography>
              <Typography
                variant="h2"
                component="h3"
                className={classes.topicLink}
              >
                <Link href="/plan/the-build">Build it right</Link>
              </Typography>
              <Typography variant="body1">
                Our platform is developer-led. We will build this right, make it
                scalable, and listen to the community to fix bugs. We want to
                make something to be proud of.
              </Typography>
            </Paper>
          </Grid>
        </Grid>
      </Container>
      <div className={classes.spacer} />
      <Container component="section" maxWidth="md">
        <Typography className={classes.para}>
          Read more about Couchers.org on our{" "}
          <StyledLink href={blogRoute}>Blog</StyledLink>.
        </Typography>
      </Container>
    </>
  );
}