Skip to content

Commit

Permalink
feat: minimum size
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldszar committed Jul 24, 2021
1 parent eba754f commit f62c00f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions public/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ window.settings = {
*/
direction: "top",

/**
* Minimum size, in pixels, of the displayed image.
* @type {Number}
*/
minSize: 200,

/**
* Maximum size, in pixels, of the displayed image.
* @type {Number}
Expand Down
2 changes: 2 additions & 0 deletions src/components/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ const App: FC = () => {
ref={imageRef}
className={styles.image}
style={{
minHeight: `${settings.minSize}px`,
minWidth: `${settings.minSize}px`,
maxHeight: `${settings.maxSize}px`,
maxWidth: `${settings.maxSize}px`,
}}
Expand Down
5 changes: 5 additions & 0 deletions src/types/settings.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ export interface Settings {
*/
direction: "top" | "right" | "bottom" | "left";

/**
* Minimum size, in pixels, of the displayed image.
*/
minSize: number;

/**
* Maximum size, in pixels, of the displayed image.
*/
Expand Down

0 comments on commit f62c00f

Please sign in to comment.