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

🪟 🎨 Update favicon and table row image styles #14020

Merged
merged 9 commits into from
Jun 29, 2022
Binary file modified airbyte-webapp/public/favicon.ico
Binary file not shown.
41 changes: 41 additions & 0 deletions airbyte-webapp/src/components/ImageBlock/ImageBlock.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
@use "../../scss/colors";
teallarson marked this conversation as resolved.
Show resolved Hide resolved

.iconContainer {
height: 25px;
width: 25px;
text-align: center;
overflow: hidden;
margin-right: 6px;
}

.circle {
height: 20px;
width: 20px;
min-width: 20px;
border-radius: 50%;
text-align: center;
margin-right: 6px;
overflow: hidden;

&.darkBlue {
background: colors.$dark-blue-100;
}
}

.small {
border-radius: 0%;
}

.icon {
max-height: 100%;
max-width: 100%;
}

.number {
font-family: "Inter";
teallarson marked this conversation as resolved.
Show resolved Hide resolved
font-style: normal;
font-weight: 600;
font-size: 10px;
color: colors.$white;
padding: 3px 0 3px;
}
44 changes: 17 additions & 27 deletions airbyte-webapp/src/components/ImageBlock/ImageBlock.tsx
Original file line number Diff line number Diff line change
@@ -1,39 +1,29 @@
import classnames from "classnames";
import React from "react";
import styled from "styled-components";

import { getIcon } from "utils/imageUtils";

interface IProps {
import styles from "./ImageBlock.module.scss";

interface ImageBlockProps {
img?: string;
className?: string;
num?: number;
small?: boolean;
}

export const Content = styled.div<{ small?: boolean }>`
height: 25px;
width: 25px;
min-width: 25px;
background: ${({ theme, small }) => (small ? "none" : theme.brightColor)};
box-shadow: ${({ theme, small }) => (small ? "none" : `0 1px 2px 0 ${theme.shadowColor}`)};
border-radius: ${({ small }) => (small ? 0 : 50)}%;
text-align: center;

overflow: hidden;
`;

export const Number = styled.div`
font-weight: 500;
font-size: 14px;
color: ${({ theme }) => theme.primaryColor};
padding: 4px 0 3px;
`;

const ImageBlock: React.FC<IProps> = ({ img, className, num, small }) => (
<Content className={className} small={small && !num}>
{num ? <Number>{num}</Number> : <>{getIcon(img)}</>}
</Content>
);
const ImageBlock: React.FC<ImageBlockProps> = ({ img, num, small }) => {
teallarson marked this conversation as resolved.
Show resolved Hide resolved
const imageCircleClassnames = classnames({
[styles.circle]: num,
[styles.iconContainer]: !num || num === undefined,
[styles.small]: small && !num,
[styles.darkBlue]: !small && num,
});
return (
<div className={imageCircleClassnames}>
{num ? <div className={styles.number}>{num}</div> : <div className={styles.icon}>{getIcon(img)}</div>}
</div>
);
};

export default ImageBlock;
export { ImageBlock };
teallarson marked this conversation as resolved.
Show resolved Hide resolved