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

used InfoBlock component in verify modals, added XOF and UGx currencies #77

Merged
merged 3 commits into from
Dec 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
8 changes: 6 additions & 2 deletions addon/components/currency-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ export default class CurrencySelectComponent extends Component {

let whois = this.currentUser.getOption('whois');

this.currency = this.args.currency ?? whois?.currency?.code ?? 'USD';
this.currency = this.args.currency ?? this.args.value ?? whois?.currency?.code ?? 'USD';
this.currencyData = this.args.currencyData ?? getCurrency(this.currency);
}

@action onChange(currency) {
const { onChange, onCurrencyChange } = this.args;
const { onChange, onCurrencyChange, onSelect } = this.args;

this.currency = currency.code;
this.currencyData = currency;
Expand All @@ -29,6 +29,10 @@ export default class CurrencySelectComponent extends Component {
onCurrencyChange(currency.code, currency);
}

if (typeof onSelect === 'function') {
onSelect(currency.code, currency);
}

if (typeof onChange === 'function') {
onChange(currency);
}
Expand Down
2 changes: 1 addition & 1 deletion addon/components/modals/create-or-join-org.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<PhoneInput @value={{@options.phone}} @onInput={{fn (mut @options.phone)}} class="form-input w-full" />
</InputGroup>
<InputGroup @name="Organization currency">
<CurrencySelect @value={{@options.currency}} @onSelect={{fn (mut @options.currency)}} @triggerClass="w-full form-select" />
<CurrencySelect @currency={{@options.currency}} @onCurrencyChange={{fn (mut @options.currency)}} @triggerClass="w-full form-select" />
</InputGroup>
{{/if}}
</div>
Expand Down
24 changes: 4 additions & 20 deletions addon/components/modals/verify-by-sms.hbs
Original file line number Diff line number Diff line change
@@ -1,25 +1,9 @@
<Modal::Default @modalIsOpened={{@modalIsOpened}} @options={{@options}} @confirm={{@onConfirm}} @decline={{@onDecline}}>
<div class="modal-body-container">
<div class="bg-yellow-50 rounded shadow-sm border-l-4 border-yellow-400 p-4 mb-5">
<div class="flex">
<div class="flex-shrink-0">
<svg class="h-5 w-5 text-yellow-400" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
<path
fill-rule="evenodd"
d="M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z"
clip-rule="evenodd"
></path>
</svg>
</div>
<div class="ml-3 flex items-center">
<span class="font-extrabold text-yellow-800">Let's verify your phone number instead.</span>
</div>
</div>
<div class="py-3">
<p class="text-yellow-700">Confirm your phone number below and click send to receive a verification code by SMS.</p>
</div>
</div>

<InfoBlock @type="info" @icon="lightbulb" @iconSize="lg" class="mb-5">
<div class="font-extrabold">Let's verify your phone number instead.</div>
<div>Confirm your phone number below and click send to receive a verification code by SMS.</div>
</InfoBlock>
<InputGroup @name="Verify your phone number" @helpText="Have a second look and confirm your phone number is correct.">
<PhoneInput @value={{@options.phone}} @onInput={{fn (mut @options.phone)}} class="form-input input-lg w-full" />
</InputGroup>
Expand Down
23 changes: 4 additions & 19 deletions addon/components/modals/verify-email.hbs
Original file line number Diff line number Diff line change
@@ -1,24 +1,9 @@
<Modal::Default @modalIsOpened={{@modalIsOpened}} @options={{@options}} @confirm={{@onConfirm}} @decline={{@onDecline}}>
<div class="modal-body-container">
<div class="bg-blue-50 rounded shadow-sm border-l-4 border-blue-400 p-4 mb-5">
<div class="flex">
<div class="flex-shrink-0">
<svg class="h-5 w-5 text-blue-400" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
<path
fill-rule="evenodd"
d="M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z"
clip-rule="evenodd"
></path>
</svg>
</div>
<div class="ml-3 flex items-center">
<span class="font-extrabold text-blue-800">Verify your email address</span>
</div>
</div>
<div class="py-3">
<p class="text-blue-700">Re-verify your email address and click Send to continue.</p>
</div>
</div>
<InfoBlock @type="info" @icon="lightbulb" @iconSize="lg" class="mb-5">
<div class="font-extrabold">Verify your email address.</div>
<div>Re-verify your email address and click Send to continue.</div>
</InfoBlock>
{{#if @options.sent}}
<InputGroup
@type="tel"
Expand Down
Loading
Loading