This commit is contained in:
Sebastian 2022-06-06 00:10:38 -03:00
parent fb6aff76d2
commit aa55cecb44
No known key found for this signature in database
GPG Key ID: BE4FF68352439FC1
14 changed files with 15163 additions and 45 deletions

View File

@ -46,8 +46,8 @@ export function DateInput(props: DateInputProps): VNode {
class={showError ? "input is-danger" : "input"}
value={value}
onKeyPress={(e) => {
if (e.key === 'Enter' && props.onConfirm) {
props.onConfirm()
if (e.key === "Enter" && props.onConfirm) {
props.onConfirm();
}
}}
onInput={(e) => {

View File

@ -39,8 +39,8 @@ export function EmailInput(props: TextInputProps): VNode {
type="email"
class={showError ? "input is-danger" : "input"}
onKeyPress={(e) => {
if (e.key === 'Enter' && props.onConfirm) {
props.onConfirm()
if (e.key === "Enter" && props.onConfirm) {
props.onConfirm();
}
}}
onInput={(e) => {

View File

@ -56,9 +56,7 @@ export function FileInput(props: FileInputProps): VNode {
<div class="icon is-small ">
<i class="mdi mdi-folder" />
</div>
<span>
{props.label}
</span>
<span>{props.label}</span>
</a>
{props.tooltip && (
<span class="icon has-tooltip-right" data-tooltip={props.tooltip}>
@ -77,7 +75,7 @@ export function FileInput(props: FileInputProps): VNode {
if (!f || f.length != 1) {
return props.onChange(undefined);
}
console.log(f)
console.log(f);
if (f[0].size > MAX_IMAGE_UPLOAD_SIZE) {
setSizeError(true);
return props.onChange(undefined);
@ -90,7 +88,11 @@ export function FileInput(props: FileInputProps): VNode {
"",
),
);
return props.onChange({content: `data:${f[0].type};base64,${b64}`, name: f[0].name, type: f[0].type});
return props.onChange({
content: `data:${f[0].type};base64,${b64}`,
name: f[0].name,
type: f[0].type,
});
});
}}
/>

View File

@ -38,8 +38,8 @@ export function PhoneNumberInput(props: TextInputProps): VNode {
placeholder={props.placeholder}
class={showError ? "input is-danger" : "input"}
onKeyPress={(e) => {
if (e.key === 'Enter' && props.onConfirm) {
props.onConfirm()
if (e.key === "Enter" && props.onConfirm) {
props.onConfirm();
}
}}
onInput={(e) => {

View File

@ -229,12 +229,8 @@ export class DatePicker extends Component<Props, State> {
}
render() {
const {
currentDate,
displayedMonth,
displayedYear,
selectYearMode,
} = this.state;
const { currentDate, displayedMonth, displayedYear, selectYearMode } =
this.state;
return (
<div>

View File

@ -84,13 +84,13 @@ export function useLocalStorage(
key: string,
initialValue?: string,
): [string | undefined, StateUpdater<string | undefined>] {
const [storedValue, setStoredValue] = useState<string | undefined>(():
| string
| undefined => {
const [storedValue, setStoredValue] = useState<string | undefined>(
(): string | undefined => {
return typeof window !== "undefined"
? window.localStorage.getItem(key) || initialValue
: initialValue;
});
},
);
const setValue = (
value?: string | ((val?: string) => string | undefined),

View File

@ -323,7 +323,7 @@ export function useAnastasisReducer(): AnastasisReducerApi {
},
});
},
async discoverMore(): Promise<void> { },
async discoverMore(): Promise<void> {},
async startRecover() {
let s: ReducerState;
if (remoteReducer) {
@ -403,7 +403,7 @@ export function useAnastasisReducer(): AnastasisReducerApi {
}
class ReducerTxImpl implements ReducerTransactionHandle {
constructor(public transactionState: ReducerState) { }
constructor(public transactionState: ReducerState) {}
async transition(action: string, args: any): Promise<ReducerState> {
let s: ReducerState;
if (remoteReducer) {

View File

@ -16,10 +16,18 @@ export interface ConfirmModelProps {
}
export function ConfirmModal({
active, description, onCancel, onConfirm, children, danger, disabled, label = "Confirm", cancelLabel = "Dismiss"
active,
description,
onCancel,
onConfirm,
children,
danger,
disabled,
label = "Confirm",
cancelLabel = "Dismiss",
}: ConfirmModelProps): VNode {
return (
<div class={active ? "modal is-active" : "modal"} >
<div class={active ? "modal is-active" : "modal"}>
<div class="modal-background " onClick={onCancel} />
<div class="modal-card" style={{ maxWidth: 700 }}>
<header class="modal-card-head">
@ -35,9 +43,13 @@ export function ConfirmModal({
<button class="button" onClick={onCancel}>
{cancelLabel}
</button>
<div class="buttons is-right" style={{ width: "100%" }} onKeyDown={(e) => {
if (e.key === 'Escape' && onCancel) onCancel()
}}>
<div
class="buttons is-right"
style={{ width: "100%" }}
onKeyDown={(e) => {
if (e.key === "Escape" && onCancel) onCancel();
}}
>
<AsyncButton
grabFocus
class={danger ? "button is-danger " : "button is-info "}
@ -52,7 +64,8 @@ export function ConfirmModal({
<button
class="modal-close is-large "
aria-label="close"
onClick={onCancel} />
onClick={onCancel}
/>
</div>
);
}

View File

@ -5,7 +5,8 @@ import { EmailInput } from "../../../components/fields/EmailInput";
import { AnastasisClientFrame } from "../index";
import { AuthMethodSetupProps } from "./index";
const EMAIL_PATTERN = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
const EMAIL_PATTERN =
/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
export function AuthMethodEmailSetup({
cancel,

View File

@ -135,9 +135,9 @@
text-align: center;
// there's probably a better way to do this, but wanted to try out CSS grid
grid-template-columns: calc(100% / 7) calc(100% / 7) calc(100% / 7) calc(
100% / 7
) calc(100% / 7) calc(100% / 7) calc(100% / 7);
grid-template-columns:
calc(100% / 7) calc(100% / 7) calc(100% / 7) calc(100% / 7)
calc(100% / 7) calc(100% / 7) calc(100% / 7);
span {
color: var(--secondary-text-color-dark);
@ -151,9 +151,9 @@
width: 100%;
display: grid;
text-align: center;
grid-template-columns: calc(100% / 7) calc(100% / 7) calc(100% / 7) calc(
100% / 7
) calc(100% / 7) calc(100% / 7) calc(100% / 7);
grid-template-columns:
calc(100% / 7) calc(100% / 7) calc(100% / 7) calc(100% / 7)
calc(100% / 7) calc(100% / 7) calc(100% / 7);
span {
color: var(--primary-text-color-dark);

View File

@ -15,8 +15,8 @@
*/
@font-face {
font-family: 'Nunito';
font-family: "Nunito";
font-style: normal;
font-weight: 400;
src: url(./fonts/XRXV3I6Li01BKofINeaE.ttf) format('truetype');
src: url(./fonts/XRXV3I6Li01BKofINeaE.ttf) format("truetype");
}

File diff suppressed because one or more lines are too long

View File

@ -14,7 +14,7 @@
GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
*/
/**
/**
*
* @author Sebastian Javier Marchano (sebasjm)
*/