Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🪟 Migrate styles for Connection-related Components #17339

Merged
merged 11 commits into from
Sep 30, 2022
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
display: none;
position: absolute;
right: variables.$spacing-xl;

// used to control svg size, not text size
font-size: 18px;
color: colors.$blue;
}
Expand All @@ -35,11 +37,7 @@
width: 100%;

h2 {
font-weight: 700;
font-size: 24px;
line-height: 29px;
text-align: center;
color: colors.$dark-blue-900;
margin: variables.$spacing-md;
word-wrap: break-word;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import React, { ChangeEvent, useState } from "react";

import { Input } from "components";
import { Text } from "components/ui/Text";

import { buildConnectionUpdate } from "core/domain/connection";
import { WebBackendConnectionRead } from "core/request/AirbyteClient";
Expand Down Expand Up @@ -85,7 +86,9 @@ export const ConnectionName: React.FC<ConnectionNameProps> = ({ connection }) =>
) : (
<button className={styles.nameContainer} onClick={() => setEditingState(true)}>
<div>
<h2>{name}</h2>
<Text as="h2" size="lg">
{name}
</Text>
</div>
<FontAwesomeIcon className={styles.icon} icon={faPenToSquare} />
</button>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
@use "../../../../scss/variables";

.tryArrow {
margin: 0 variables.$spacing-md -1px 0;

// used to control svg size
font-size: 14px;
}

.content {
max-width: 1279px;
margin: 0 auto;
padding-bottom: variables.$spacing-md;
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import React, { useMemo, useState } from "react";
import { FormattedMessage, useIntl } from "react-intl";
import { useAsyncFn, useUnmount } from "react-use";
import styled from "styled-components";

import { LabeledSwitch } from "components/LabeledSwitch";
import LoadingSchema from "components/LoadingSchema";
Expand All @@ -27,6 +26,8 @@ import { equal, naturalComparatorBy } from "utils/objects";
import { CatalogDiffModal } from "views/Connection/CatalogDiffModal/CatalogDiffModal";
import { ConnectionForm } from "views/Connection/ConnectionForm";

import styles from "./ConnectionReplicationTab.module.scss";

interface ConnectionReplicationTabProps {
onAfterSaveSchema: () => void;
connectionId: string;
Expand Down Expand Up @@ -74,17 +75,6 @@ const ResetWarningModal: React.FC<ResetWarningModalProps> = ({ onCancel, onClose
);
};

const Content = styled.div`
max-width: 1279px;
margin: 0 auto;
padding-bottom: 10px;
`;

const TryArrow = styled(FontAwesomeIcon)`
margin: 0 10px -1px 0;
font-size: 14px;
`;

export const ConnectionReplicationTab: React.FC<ConnectionReplicationTabProps> = ({
onAfterSaveSchema,
connectionId,
Expand Down Expand Up @@ -221,7 +211,7 @@ export const ConnectionReplicationTab: React.FC<ConnectionReplicationTabProps> =
};

return (
<Content>
<div className={styles.content}>
{!isRefreshingCatalog && connection ? (
<ConnectionFormServiceProvider
connection={connection}
Expand All @@ -239,7 +229,7 @@ export const ConnectionReplicationTab: React.FC<ConnectionReplicationTabProps> =
onClick={onRefreshSourceSchema}
type="button"
variant="secondary"
icon={<TryArrow icon={faSyncAlt} />}
icon={<FontAwesomeIcon className={styles.tryArrow} icon={faSyncAlt} />}
>
<FormattedMessage id="connection.updateSchema" />
</Button>
Expand All @@ -249,6 +239,6 @@ export const ConnectionReplicationTab: React.FC<ConnectionReplicationTabProps> =
) : (
<LoadingSchema />
)}
</Content>
</div>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
@use "../../../scss/variables";

.formContainer {
display: flex;
flex-direction: column;
gap: variables.$spacing-md;
}

.readonly {
pointer-events: none;
}

.flexRow {
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: flex-start;
gap: variables.$spacing-md;
}

.leftFieldCol {
flex: 1;
max-width: 640px;
padding-right: variables.$spacing-xl;
}

.rightFieldCol {
flex: 1;
max-width: 300px;
}
Loading