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

chore: remove extra code, add vite build, add tests #62

Merged
merged 8 commits into from
Jan 23, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: cleanup styles partially
  • Loading branch information
sztok7 authored and mpetrunic committed Jan 23, 2024
commit e92ff203cde3a79a8860d460e9af8a24f20ef2aa
28 changes: 8 additions & 20 deletions packages/widget/src/components/amount-selector/styles.ts
Original file line number Diff line number Diff line change
@@ -6,65 +6,53 @@ export const styles = css`
padding: 4px 12px;
align-items: center;
border-radius: 24px;
width: 314px;
height: 116px;
width: 314px; /* TODO: remove hardcoded values */
height: 116px; /* TODO: ↑ */
flex-direction: column;
}

.amountSelectorLabel {
display: flex;
width: 100%;
flex-direction: row;
justify-content: flex-start;
color: var(--neutral-600, #525252);
font-family: Inter;
color: #525252;
font-size: 14px;
font-style: normal;
font-weight: 500;
line-height: 20px; /* 142.857% */
}

.amountSelectorSection {
display: flex;
width: 100%;
flex-direction: row;
justify-content: space-between;
align-items: center;
}

.amountSelectorInput {
border: none;
color: var(--neutral-600, #525252);
font-family: Inter;
color: #525252;
font-size: 34px;
font-style: normal;
font-weight: 500;
line-height: 40px; /* 117.647% */
line-height: 40px;
letter-spacing: -0.68px;
width: 137px;
width: 137px; /* TODO: remove hardcoded values */
}

.tokenBalanceSection {
display: flex;
flex-direction: row;
align-self: flex-start;
margin-top: 8px;
width: 100%;
}

.balanceContent {
display: flex;
flex-direction: row;
width: 100%;
justify-content: flex-end;
}

.balanceContent > span {
margin-right: 6px;
gap: 6px;
}

.maxButton {
color: var(--blue-600, #2563eb);
color: #2563eb;
border: none;
background: none;
font-weight: 500;
20 changes: 8 additions & 12 deletions packages/widget/src/components/network-selector/styles.ts
Original file line number Diff line number Diff line change
@@ -3,46 +3,42 @@ import { css } from 'lit';
export const styles = css`
.selectorContainer {
border-radius: 24px;
border: 1px solid var(--zinc-200, #e4e4e7);
border: 1px solid #e4e4e7;
display: flex;
width: 314px;
padding: 12px 16px;
flex-direction: column;
justify-content: center;
align-items: flex-start;
align-items: stretch;
gap: 4px;
}

.directionLabel {
color: var(--zinc-400, #a1a1aa);
font-family: Inter;
color: #a1a1aa;
font-size: 14px;
font-style: normal;
font-weight: 500;
line-height: 20px;
display: flex;
flex-direction: column;
justify-content: center;
flex: 1 0 0;
align-self: stretch;
}

.baseSelector {
width: 100%;
}

.selector {
width: 100%;
color: var(--neutral-600, #525252);
font-family: Inter;
color: #525252;
font-size: 18px;
font-style: normal;
font-weight: 500;
line-height: 26px;
border: none;
}

.selectorSection {
display: flex;
align-items: center;
gap: 12px;
align-self: stretch;
width: inherit;
}
`;
70 changes: 33 additions & 37 deletions packages/widget/src/styles.ts
Original file line number Diff line number Diff line change
@@ -7,54 +7,48 @@ export const styles = css`
font-weight: 500;
src: url('https://fonts.googleapis.com/css2?family=Inter:wght@200..900');
}

.widgetContainer {
display: flex;
flex-direction: column;
align-items: center;
gap: 16px;

padding: 24px;
width: 350px;
height: 476px;
padding: 24px;
width: 350px; /* TODO: remove these hardcoded values */
height: 476px; /* TODO: ↑ */
border-radius: 12px;
border: 1px solid var(--gray-100, #f3f4f6);
background: #fff;
border: 1px solid #f3f4f6;
background-color: #fff;

box-shadow:
0px 4px 6px -1px rgba(0, 0, 0, 0.1),
0px 2px 4px -1px rgba(0, 0, 0, 0.06);
0 4px 6px -1px rgba(0, 0, 0, 0.1),
0 2px 4px -1px rgba(0, 0, 0, 0.06);

font-family: 'Bungee Spice';
font-family: Inter, sans-serif;
}

.switchNetwork {
.connectAccount {
display: flex;
flex-direction: row;
justify-content: flex-end;
color: var(--neutral-600, #525252);
text-align: right;
font-family: Inter;
font-size: 14px;
font-style: normal;
font-weight: 500;
line-height: 18px;
}

.switchNetwork > span:nth-child(2) {
margin-left: 4px;
align-items: center;
gap: 4px;
}

.actionButton {
display: flex;
width: 314px;
padding: 12px 20px;
justify-content: center;
align-items: center;
gap: 8px;

border-radius: 16px;
background: var(--primary-300, #a5b4fc);
color: #ffffff;
border: none;
font-family: Inter;
background-color: #a5b4fc;
color: #ffffff;

width: 314px; /* TODO: remove these hardcoded values */
padding: 12px 20px;

font-weight: 500;
font-size: 16px;
}
@@ -64,24 +58,26 @@ export const styles = css`
}

.actionButton:active {
background: var(--primary-500-main, #6366f1);
background-color: #6366f1;
}

.actionButtonReady {
display: flex;
width: 314px;
padding: 12px 20px;
justify-content: center;
align-items: center;
gap: 8px;

width: 100%;
padding: 12px 20px;

border-radius: 16px;
background: var(--primary-500-main, #6366f1);
background-color: #6366f1;
color: #ffffff;
border: none;
}

.actionButtonReady:active {
background: var(--primary-300, #a5b4fc);
background-color: #a5b4fc;
}

.actionButtonReady:hover {
@@ -90,12 +86,12 @@ export const styles = css`

.poweredBy {
display: flex;
flex-direction: row;
justify-content: flex-start;
margin-top: 16px;
}
align-items: center;
gap: 6px;
align-self: flex-start;

.poweredBy > span:nth-child(2) {
margin-left: 6px;
color: #525252;
font-size: 12px;
line-height: 150%;
}
`;
8 changes: 2 additions & 6 deletions packages/widget/src/widget.ts
Original file line number Diff line number Diff line change
@@ -20,8 +20,7 @@ class SygmaProtocolWidget extends LitElement {
<section class="widgetContainer">
<form @submit=${() => {}}>
<section class="connectAccount">
<span>${switchNetworkIcon}</span>
<span>Connect Wallet</span>
${switchNetworkIcon} Connect Wallet
</section>
<section>
<sygma-network-selector
@@ -63,10 +62,7 @@ class SygmaProtocolWidget extends LitElement {
</button>
</section>
</form>
<section class="poweredBy">
<span>${sygmaLogo}</span>
<span>Powered by Sygma</span>
</section>
<section class="poweredBy">${sygmaLogo} Powered by Sygma</section>
</section>
`;
}