This repository has been archived by the owner on Apr 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Merge pull request #99 from stiftelsen-effekt/revert-98-stage"
- Loading branch information
1 parent
268a6e7
commit 3d3c2db
Showing
34 changed files
with
4,668 additions
and
1,836 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,30 @@ | ||
import { PaymentMethod, RecurringDonation } from "../../../types/Enums"; | ||
import { Donation } from "../../../store/state"; | ||
|
||
export const displayClaimWarning = (donation: Donation): boolean => { | ||
if ( | ||
donation.method !== PaymentMethod.BANK || | ||
donation.recurring !== RecurringDonation.RECURRING | ||
) | ||
return false; | ||
|
||
const timeStamp = new Date(); | ||
const today = timeStamp.getDate(); | ||
const daysInMonth = new Date( | ||
timeStamp.getFullYear(), | ||
timeStamp.getMonth(), | ||
0 | ||
).getDate(); | ||
|
||
if (donation.dueDay) { | ||
if (today + 5 <= 28) { | ||
if (donation.dueDay - today < 0) return false; | ||
if (donation.dueDay - today < 5) return true; | ||
return false; | ||
} | ||
if (donation.dueDay > today) return true; | ||
if (donation.dueDay < today + 5 - daysInMonth) return true; | ||
return false; | ||
} | ||
return false; | ||
}; |
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
22 changes: 22 additions & 0 deletions
22
src/components/panes/PaymentPane/Bank/PaymentInformation.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import React from "react"; | ||
import { Donation } from "../../../../store/state"; | ||
import { RoundedBorder } from "../../../shared/Layout/Layout.style"; | ||
import { HorizontalLine, TextWrapper } from "./ResultPane.style"; | ||
|
||
export const PaymentInformation: React.FC<{ | ||
donation: Donation; | ||
}> = ({ donation }) => { | ||
return ( | ||
<RoundedBorder> | ||
<TextWrapper> | ||
<b>Kontonr</b> | ||
<span>1506 29 95960</span> | ||
</TextWrapper> | ||
<HorizontalLine /> | ||
<TextWrapper> | ||
<b>KID</b> | ||
<span data-cy="kidNumber">{donation.kid}</span> | ||
</TextWrapper> | ||
</RoundedBorder> | ||
); | ||
}; |
22 changes: 22 additions & 0 deletions
22
src/components/panes/PaymentPane/Bank/RecurringForm.style.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import styled from "styled-components"; | ||
|
||
export const AvtaleGiroButton = styled.button` | ||
padding: 16px; | ||
background: none; | ||
border: none; | ||
margin: 30px auto; | ||
box-sizing: border-box; | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
text-align: right; | ||
width: 80%; | ||
background: rgba(93, 56, 0, 1); | ||
box-shadow: 0px 1px 5px 2px #00000030; | ||
border-radius: 5px; | ||
color: white; | ||
font-family: "Roboto"; | ||
font-weight: 600; | ||
font-size: 16px; | ||
cursor: pointer; | ||
`; |
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,56 @@ | ||
import React from "react"; | ||
import { Donation } from "../../../../store/state"; | ||
import AvtaleGiroLogo from "../../../../assets/avtalegiro.jpeg"; | ||
import { AvtaleGiroButton } from "./RecurringForm.style"; | ||
import { API_URL } from "../../../../config/api"; | ||
import { RoundedBorder } from "../../../shared/Layout/Layout.style"; | ||
|
||
export const RecurringBankDonationForm: React.FC<{ | ||
donation: Donation; | ||
}> = ({ donation }) => { | ||
return ( | ||
<RoundedBorder style={{ marginBottom: 10 }}> | ||
<form | ||
action="https://pvu.nets.no/ecsa/start" | ||
method="post" | ||
target="_parent" | ||
> | ||
<input | ||
type="hidden" | ||
name="companyName" | ||
id="companyName" | ||
value="Effektiv Altruisme Norge" | ||
/> | ||
<input | ||
type="hidden" | ||
name="companyAccountNo" | ||
id="companyAccountNo" | ||
value="15062995960" | ||
/> | ||
<input type="hidden" name="kid" id="kid" value={donation.kid} /> | ||
<input | ||
type="hidden" | ||
name="amountLimit" | ||
id="amountLimit" | ||
value={donation.sum || 1000} | ||
/> | ||
<input | ||
type="hidden" | ||
name="returnUrl" | ||
id="returnUrl" | ||
value={`${API_URL}/donations/status`} | ||
/> | ||
<input | ||
type="hidden" | ||
name="notificationDisabled" | ||
id="notificationDisabled" | ||
value="false" | ||
/> | ||
<AvtaleGiroButton type="submit"> | ||
Opprett avtale | ||
<img src={AvtaleGiroLogo} alt="AvtaleGiro logo" height={20} /> | ||
</AvtaleGiroButton> | ||
</form> | ||
</RoundedBorder> | ||
); | ||
}; |
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
Oops, something went wrong.