Skip to content

Commit

Permalink
feat: refactor connector form
Browse files Browse the repository at this point in the history
  • Loading branch information
pavanjoshi914 committed Feb 2, 2024
1 parent 4ea97f3 commit 46473cf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 26 deletions.
14 changes: 7 additions & 7 deletions src/app/components/ConnectorForm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function ConnectorForm({
<div className="flex h-full justify-center items-center">
{video && (
<div
className="flex-1 relative h-0 mb-6"
className="flex-1 relative h-0"
style={{ paddingBottom: "56.25%" }}
>
<video className="absolute t-0 l-0 w-full h-full" controls>
Expand All @@ -42,7 +42,7 @@ function ConnectorForm({
)}
{image && (
<>
<div className="w-96 mb-6">
<div className="w-96">
<img
src={image}
alt="Screenshot"
Expand All @@ -56,8 +56,8 @@ function ConnectorForm({

return (
<form onSubmit={onSubmit}>
<div className="max-w-xl mx-auto mt-6 relative bg-white dark:bg-surface-02dp p-10 rounded-2xl border border-gray-200 darK:border-neutral-700">
<div className="flex items-center mb-4">
<div className="flex flex-col max-w-xl mx-auto mt-6 relative bg-white dark:bg-surface-02dp p-10 rounded-2xl border border-gray-200 dark:border-neutral-700 gap-4">
<div className="flex items-center">
{logo && <img src={logo} className="w-16 mr-4 rounded-lg" />}
{/*
TODO: this can be simplified to always wrap the title in h1, without checking if it
Expand All @@ -71,17 +71,17 @@ function ConnectorForm({
)}
</div>
{description && (
<div className="text-gray-700 dark:text-white whitespace-pre-line mb-8">
<div className="text-gray-700 dark:text-white whitespace-pre-line">
{typeof description === "string" ? (
<p className="mb-6">{description}</p>
) : (
description
)}
</div>
)}
{media}
{video || (image && media)}
<div>{children}</div>
<div className="mt-8 flex justify-center">
<div className="mt-4 flex justify-center">
<Button
type="submit"
label={submitLabel}
Expand Down
19 changes: 1 addition & 18 deletions src/app/router/Welcome/Welcome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import SetPassword from "@screens/Onboard/SetPassword";
import TestConnection from "@screens/Onboard/TestConnection";
import ChooseConnector from "@screens/connectors/ChooseConnector";
import { useState } from "react";
import { useTranslation } from "react-i18next";
import { Outlet, Route, HashRouter as Router, Routes } from "react-router-dom";
import Container from "~/app/components/Container";
import LocaleSwitcher from "~/app/components/LocaleSwitcher/LocaleSwitcher";
Expand Down Expand Up @@ -54,8 +53,6 @@ function Welcome() {
}

function Layout() {
const { t } = useTranslation();

const [languageChanged, setLanguageChanged] = useState(false);
i18n.on("languageChanged", () => {
// Trigger rerender to update displayed language
Expand All @@ -70,21 +67,7 @@ function Layout() {
<div className="flex justify-center items-center">
<div className="w-full">
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 mb-8">
<div className="text-center font-serif font-medium text-2xl mt-8 dark:text-white">
<p>
{t("welcome.title")}
<img
src="assets/icons/alby_icon_yellow.svg"
alt="Alby"
className="dark:hidden inline align-middle w-6 ml-2"
/>
<img
src="assets/icons/alby_icon_yellow_dark.svg"
alt="Alby"
className="hidden dark:inline align-middle w-6 ml-2"
/>
</p>
</div>
<div className="text-center font-serif font-medium text-2xl mt-8 dark:text-white"></div>
</div>
<Container maxWidth="xl">
<Outlet />
Expand Down
1 change: 0 additions & 1 deletion src/i18n/locales/en/translation.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{

Check warning on line 1 in src/i18n/locales/en/translation.json

View workflow job for this annotation

GitHub Actions / Check source translation file for changes

Translation source translation.welcome.set_password.title has changed

Consider running `node scripts/remove-outdated-translations.js translation.welcome.set_password.title` to reset existing translations.

Check warning on line 1 in src/i18n/locales/en/translation.json

View workflow job for this annotation

GitHub Actions / Check source translation file for changes

Translation source translation.welcome.set_password.errors.enter_password has changed

Consider running `node scripts/remove-outdated-translations.js translation.welcome.set_password.errors.enter_password` to reset existing translations.

Check warning on line 1 in src/i18n/locales/en/translation.json

View workflow job for this annotation

GitHub Actions / Check source translation file for changes

Translation source translation.welcome.set_password.errors.confirm_password has changed

Consider running `node scripts/remove-outdated-translations.js translation.welcome.set_password.errors.confirm_password` to reset existing translations.

Check warning on line 1 in src/i18n/locales/en/translation.json

View workflow job for this annotation

GitHub Actions / Check source translation file for changes

Translation source translation.welcome.set_password.errors.mismatched_password has changed

Consider running `node scripts/remove-outdated-translations.js translation.welcome.set_password.errors.mismatched_password` to reset existing translations.

Check warning on line 1 in src/i18n/locales/en/translation.json

View workflow job for this annotation

GitHub Actions / Check source translation file for changes

Translation source translation.choose_connector.lnc.page.title has changed

Consider running `node scripts/remove-outdated-translations.js translation.choose_connector.lnc.page.title` to reset existing translations.

Check warning on line 1 in src/i18n/locales/en/translation.json

View workflow job for this annotation

GitHub Actions / Check source translation file for changes

Translation source translation.choose_connector.lnc.page.description has changed

Consider running `node scripts/remove-outdated-translations.js translation.choose_connector.lnc.page.description` to reset existing translations.

Check warning on line 1 in src/i18n/locales/en/translation.json

View workflow job for this annotation

GitHub Actions / Check source translation file for changes

Translation source common.advanced has changed

Consider running `node scripts/remove-outdated-translations.js common.advanced` to reset existing translations.
"translation": {
"welcome": {
"title": "Welcome to Alby",
"set_password": {
"title": "Set extension unlock passcode",
"description1": "Set a passcode to unlock Alby Extension in this browser",
Expand Down

0 comments on commit 46473cf

Please sign in to comment.