Skip to content

Commit

Permalink
Center the form for the website
Browse files Browse the repository at this point in the history
  • Loading branch information
stepchowfun committed Jan 5, 2024
1 parent d9b6dc9 commit 37fa232
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 20 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.1.6] - 2024-01-05

Nothing changed in this version except internal refactoring needed to support the website. Before this version, Hashpass was only a Chrome extension and not a standalone website.

## [2.1.5] - 2022-02-09

### Changed
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Hashpass",
"description": "A simple password manager with a twist.",
"version": "2.1.5",
"version": "2.1.6",
"manifest_version": 3,
"permissions": ["activeTab", "scripting"],
"action": {
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hashpass",
"version": "2.1.5",
"version": "2.1.6",
"scripts": {
"build-production": "rm -rf dist && webpack --config webpack.production.js",
"build-development": "rm -rf dist && webpack --config webpack.development.js",
Expand Down
28 changes: 15 additions & 13 deletions src/loader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@ import * as React from 'react';
import { createUseStyles } from 'react-jss';
import { useEffect, useState } from 'react';

import UserInterface from './user-interface';
import fireAndForget from './fire-and-forget';
import getDomain from './get-domain';
import getIsPasswordFieldActive from './get-is-password-field-active';

const width = '320px';
const height = '256px';
import { UserInterface, width, height } from './user-interface';

const useStyles = createUseStyles({
loading: {
loader: {
display: 'flow-root',
width,
height,
position: 'absolute',
top: '50%',
left: '50%',
transform: 'translate(-50%, -50%)',
},
});

Expand All @@ -36,15 +38,15 @@ const Loader = (): React.ReactElement => {
);
}, []);

if (domain === undefined || isPasswordFieldActive === undefined) {
return <div className={classes.loading} />;
}

return (
<UserInterface
initialDomain={domain}
isPasswordFieldActive={isPasswordFieldActive}
/>
<div className={classes.loader}>
{domain !== undefined && isPasswordFieldActive !== undefined && (
<UserInterface
initialDomain={domain}
isPasswordFieldActive={isPasswordFieldActive}
/>
)}
</div>
);
};

Expand Down
6 changes: 4 additions & 2 deletions src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import preset from 'jss-preset-default';
import { createRoot } from 'react-dom/client';

import Loader from './loader';
import { width, height } from './user-interface';

jss.setup(preset());

Expand All @@ -14,8 +15,9 @@ jss
boxSizing: 'border-box',
margin: 0,
},
'html, body': {
width: '352px',
html: {
minWidth: width,
minHeight: height,
},
body: {
// Create a block formatting context to contain margins of descendants.
Expand Down
4 changes: 3 additions & 1 deletion src/user-interface.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import fireAndForget from './fire-and-forget';
import hashpass from './worker-client';
import { Button } from './button';

const width = '352px';
const height = '256px';
const debounceMilliseconds = 200;
const copyToClipboardSuccessIndicatorMilliseconds = 1000;

Expand Down Expand Up @@ -266,4 +268,4 @@ const UserInterface = ({
);
};

export default UserInterface;
export { UserInterface, width, height };

0 comments on commit 37fa232

Please sign in to comment.