-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: modal responsiveness * fix: viewport * fix: lint warnings * fix: modal
- Loading branch information
1 parent
eae93c8
commit adcacc0
Showing
17 changed files
with
66 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 4 additions & 2 deletions
6
packages/react-wallet-kit/src/ConnectWalletButton/Components/ThemeSelector.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './responsive'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { LitElement } from 'lit'; | ||
import { property } from 'lit/decorators'; | ||
import { addResizeListeners } from '../utils'; | ||
import { Breakpoint } from '../constants'; | ||
|
||
export enum Media { | ||
Mobile = 'mobile', | ||
Tablet = 'tablet', | ||
Desktop = 'desktop', | ||
} | ||
|
||
export class ResponsiveLitElement extends LitElement { | ||
@property() | ||
media = Media.Desktop; | ||
|
||
private setCurrentMedia = (): void => { | ||
if (window.screen.width <= Breakpoint.Mobile) { | ||
this.media = Media.Mobile; | ||
return; | ||
} | ||
if (window.screen.width <= Breakpoint.Tablet) { | ||
this.media = Media.Tablet; | ||
return; | ||
} | ||
this.media = Media.Desktop; | ||
}; | ||
|
||
constructor() { | ||
super(); | ||
addResizeListeners(this.setCurrentMedia); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export const Breakpoint = { | ||
Mobile: 500, | ||
Tablet: 800, | ||
}; |
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
// TODO: use the wallet-kit package instead of this one | ||
export * from './enums'; | ||
export * from './colors'; | ||
export * from './sources'; | ||
export * from './breakpoint'; |
7 changes: 1 addition & 6 deletions
7
...wallet-kit/src/constants/enums/sources.ts → ...nilla-wallet-kit/src/constants/sources.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
export * from './qr-code'; | ||
export * from './listeners'; | ||
export * from './events'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export const addResizeListeners = (callback: () => void): void => { | ||
window.addEventListener('load', callback, false); | ||
window.addEventListener('resize', callback, false); | ||
}; |