-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4836 from cowprotocol/release/2024-08-26
chore(release):2024 08 26
- Loading branch information
Showing
112 changed files
with
7,743 additions
and
922 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -49,11 +49,13 @@ export default function Page({ siteConfigData }: PageProps) { | |
<BodyContent> | ||
<h2> | ||
Know someone who is not just looking for a job but for a great opportunity to grow? Refer them to us to | ||
earn $6,000 in USDC or USD. | ||
earn up to $6,000 in USDC or USD. | ||
</h2> | ||
<p> | ||
We will reward you with a referral bonus of <b>6,000 USDC or USD</b> per placement. Your referral is | ||
successful and paid once the Candidate clears <b>their first 3 months</b> of work in their new role. | ||
We will reward you with a referral bonus of up to <b>6,000 USDC or USD</b> per placement. The referral | ||
bonus amount can vary for each role. You can find the exact amount listed in the job description on our | ||
website at <a href="https://cow.fi/careers">https://cow.fi/careers</a>. Your referral is successful and | ||
paid once the Candidate clears <b>their first 6 months</b> of work in their new role. | ||
</p> | ||
|
||
<p> | ||
|
@@ -89,15 +91,15 @@ export default function Page({ siteConfigData }: PageProps) { | |
someone else first, the Referrer is not eligible. | ||
</li> | ||
<li> | ||
If two or more Referrers refer the same Candidate, then only the <b>first</b> Referrer provided by | ||
such Candidate will be eligible for the referral bonus. We will let the Referrers know. | ||
If two or more Referrers refer the same Candidate, only the <b>first</b> Referrer provided by such | ||
Candidate will be eligible for the referral bonus. We will let the Referrers know. | ||
</li> | ||
<li>There is no limit to the number of referrals that a Referrer can make.</li> | ||
</ul> | ||
|
||
<h4>Candidates Eligibility</h4> | ||
<ul> | ||
<li>Any individual (or entity) who is not the Referrer, or a current or former contractor of CoW.</li> | ||
<li>Any individual (or entity) who is not the Referrer or a current or former contractor of CoW.</li> | ||
<li> | ||
Any individual who is not bound by non-compete agreements or any other similar agreements that would | ||
prohibit CoW from engaging with them. | ||
|
@@ -106,6 +108,12 @@ export default function Page({ siteConfigData }: PageProps) { | |
|
||
<h4>Referral Procedures</h4> | ||
<ul> | ||
<li> | ||
The referrer should reach out to a CoW core team member or directly contact the People department via | ||
email at <a href="mailto:[email protected]">[email protected]</a>, LinkedIn, or Telegram. When reaching out, | ||
the Referrer must include the candidate's name, surname, and email or LinkedIn profile. The Referrer | ||
is responsible for ensuring that the Candidate has given consent to share this information. | ||
</li> | ||
<li> | ||
To apply for a specific role at CoW, <b>Candidates</b> are required to submit their application | ||
through the official website: <a href="https://cow.fi/careers">https://cow.fi/careers</a>.{' '} | ||
|
@@ -130,10 +138,12 @@ export default function Page({ siteConfigData }: PageProps) { | |
<h4>Referral bonus and invoice</h4> | ||
<ul> | ||
<li> | ||
The Referrer becomes eligible to receive the full referral bonus of five thousand USDC or USD (6,000) | ||
after three (3) months from the Candidate's start date, provided that the Candidate remains | ||
providing services to CoW during this period. The Referrer can decide if they want to be paid in USDC | ||
or USD. | ||
The Referrer becomes eligible to receive the full referral bonus up to six thousand USDC or USD | ||
(6,000) after six (6) months from the Candidate's start date, provided that the Candidate remains | ||
providing services to CoW during this period. The referral bonus amount can vary for each role. You | ||
can find the exact amount listed in the job description on our website at{' '} | ||
<a href="https://cow.fi/careers">https://cow.fi/careers</a>. The Referrer can decide if they want to | ||
be paid in USDC or USD. | ||
</li> | ||
<li> | ||
The referral bonus is excl. VAT (VAT can be added), but net of any other tax, such as, income tax or | ||
|
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
47 changes: 47 additions & 0 deletions
47
...wswap-frontend/src/common/hooks/orderProgressBarV2/ProgressBarV2ExecutingOrdersUpdater.ts
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,47 @@ | ||
import { useAtom } from 'jotai' | ||
import { useLayoutEffect, useRef } from 'react' | ||
|
||
import { ordersProgressBarCountdown } from './atoms' | ||
import { OrdersProgressBarCountdown } from './types' | ||
|
||
export function ProgressBarV2ExecutingOrdersUpdater(): null { | ||
useCountdownUpdater() | ||
|
||
return null | ||
} | ||
|
||
function useCountdownUpdater() { | ||
const [allCountdowns, setCountdowns] = useAtom(ordersProgressBarCountdown) | ||
|
||
// Use a ref to not restart the updater on every change | ||
const countdownsRef = useRef(allCountdowns) | ||
// Important! Update the ref on every re-render | ||
countdownsRef.current = allCountdowns | ||
|
||
useLayoutEffect(() => { | ||
function updateCountdowns() { | ||
const countdowns = countdownsRef.current | ||
|
||
const orderIds = Object.keys(countdowns) | ||
if (!orderIds.length || orderIds.every((orderId) => !countdowns[orderId])) { | ||
// Skip update if there are no countdowns or none of them are truthy | ||
return | ||
} | ||
|
||
const newCountdowns = orderIds.reduce<OrdersProgressBarCountdown>((acc, orderId) => { | ||
const value = countdowns[orderId] | ||
|
||
// Decrement counter | ||
acc[orderId] = value && value - 1 >= 0 ? value - 1 : value | ||
|
||
return acc | ||
}, {}) | ||
|
||
setCountdowns(newCountdowns) | ||
} | ||
|
||
const timer = setInterval(updateCountdowns, 1000) | ||
|
||
return () => clearInterval(timer) | ||
}, [setCountdowns]) | ||
} |
163 changes: 163 additions & 0 deletions
163
apps/cowswap-frontend/src/common/hooks/orderProgressBarV2/atoms.ts
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,163 @@ | ||
import { atom } from 'jotai' | ||
|
||
import { deepEqual } from '@cowprotocol/common-utils' | ||
|
||
import { | ||
OrderProgressBarState, | ||
OrderProgressBarStepName, | ||
OrdersProgressBarCountdown, | ||
OrdersProgressBarState, | ||
} from './types' | ||
|
||
/** | ||
* Base Atom for orders progress bar state | ||
*/ | ||
export const ordersProgressBarStateAtom = atom<OrdersProgressBarState>({}) | ||
|
||
/** | ||
* Derived atom exposing only the countdown | ||
*/ | ||
export const ordersProgressBarCountdown = atom( | ||
(get) => { | ||
const fullState = get(ordersProgressBarStateAtom) | ||
|
||
return Object.keys(fullState).reduce<OrdersProgressBarCountdown>((acc, orderId) => { | ||
const countdown = fullState[orderId].countdown | ||
if (countdown) { | ||
acc[orderId] = countdown | ||
} | ||
return acc | ||
}, {}) | ||
}, | ||
(get, set, countdowns: OrdersProgressBarCountdown) => { | ||
const fullState = { ...get(ordersProgressBarStateAtom) } | ||
Object.keys(countdowns).forEach((orderId) => { | ||
fullState[orderId].countdown = countdowns[orderId] | ||
}) | ||
set(ordersProgressBarStateAtom, fullState) | ||
} | ||
) | ||
|
||
type UpdateOrderProgressBarCountdownParams = { | ||
orderId: string | ||
value: number | null | ||
} | ||
|
||
/** | ||
* Derived write-only atom for updating a single countdown at a time | ||
*/ | ||
export const updateOrderProgressBarCountdown = atom( | ||
null, | ||
(get, set, { orderId, value }: UpdateOrderProgressBarCountdownParams) => { | ||
const fullState = get(ordersProgressBarStateAtom) | ||
|
||
const singleOrderState = { ...fullState[orderId] } | ||
const currentValue = singleOrderState.countdown | ||
|
||
if (currentValue === value) { | ||
return | ||
} | ||
|
||
if (value === null) { | ||
delete singleOrderState.countdown | ||
} else { | ||
singleOrderState.countdown = value | ||
} | ||
|
||
set(ordersProgressBarStateAtom, { ...fullState, [orderId]: singleOrderState }) | ||
} | ||
) | ||
|
||
type UpdateOrderProgressBarStepNameParams = { | ||
orderId: string | ||
value: OrderProgressBarStepName | ||
} | ||
|
||
/** | ||
* Derived write-only atom for updating a single progressBarStepName at a time | ||
*/ | ||
export const updateOrderProgressBarStepName = atom( | ||
null, | ||
(get, set, { orderId, value }: UpdateOrderProgressBarStepNameParams) => { | ||
const fullState = get(ordersProgressBarStateAtom) | ||
|
||
const singleOrderState = { ...fullState[orderId] } | ||
const currentValue = singleOrderState.progressBarStepName | ||
|
||
if (currentValue === value) { | ||
return | ||
} | ||
|
||
// Keep track of previous status | ||
singleOrderState.previousStepName = singleOrderState.progressBarStepName | ||
// Update current status | ||
singleOrderState.progressBarStepName = value | ||
// Keep track when state was changed | ||
singleOrderState.lastTimeChangedSteps = Date.now() | ||
|
||
set(ordersProgressBarStateAtom, { ...fullState, [orderId]: singleOrderState }) | ||
} | ||
) | ||
|
||
type UpdateOrderProgressBarBackendInfoParams = { | ||
orderId: string | ||
value: Pick<OrderProgressBarState, 'backendApiStatus' | 'solverCompetition'> | ||
} | ||
|
||
/** | ||
* Derived write-only atom for updating a single order backendApiStatus and solverCompetition | ||
*/ | ||
export const updateOrderProgressBarBackendInfo = atom( | ||
null, | ||
(get, set, { orderId, value: { backendApiStatus, solverCompetition } }: UpdateOrderProgressBarBackendInfoParams) => { | ||
const fullState = get(ordersProgressBarStateAtom) | ||
|
||
const singleOrderState = { ...fullState[orderId] } | ||
const currentBackendApiStatus = singleOrderState.backendApiStatus | ||
const currentSolverCompetition = singleOrderState.solverCompetition | ||
|
||
const backendApiStatusChanged = currentBackendApiStatus !== backendApiStatus | ||
|
||
const solverCompetitionChanged = | ||
(!currentSolverCompetition && !!solverCompetition) || | ||
(!!currentSolverCompetition && !solverCompetition) || | ||
(!!currentSolverCompetition && !!solverCompetition && !deepEqual(currentSolverCompetition, solverCompetition)) | ||
|
||
if (!backendApiStatusChanged && !solverCompetitionChanged) { | ||
return | ||
} | ||
|
||
singleOrderState.previousBackendApiStatus = currentBackendApiStatus | ||
singleOrderState.backendApiStatus = backendApiStatus | ||
|
||
// Only update solver competition if changed and not falsy | ||
if (solverCompetitionChanged && solverCompetition) { | ||
singleOrderState.solverCompetition = solverCompetition | ||
} | ||
|
||
set(ordersProgressBarStateAtom, { | ||
...fullState, | ||
[orderId]: singleOrderState, | ||
}) | ||
} | ||
) | ||
|
||
/** | ||
* Derived write-only atom for setting cancellationTriggered | ||
* | ||
* Can only set it to true, since there's no way to cancel a cancellation once requested | ||
*/ | ||
export const setOrderProgressBarCancellationTriggered = atom(null, (get, set, orderId: string) => { | ||
const fullState = get(ordersProgressBarStateAtom) | ||
|
||
const singleState = { ...fullState[orderId] } | ||
|
||
if (singleState.cancellationTriggered) { | ||
// Already triggered, nothing to do here | ||
return | ||
} | ||
|
||
singleState.cancellationTriggered = true | ||
|
||
set(ordersProgressBarStateAtom, { ...fullState, [orderId]: singleState }) | ||
}) |
3 changes: 3 additions & 0 deletions
3
apps/cowswap-frontend/src/common/hooks/orderProgressBarV2/index.ts
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,3 @@ | ||
export * from './useOrderProgressBarV2Props' | ||
export * from './types' | ||
export * from './ProgressBarV2ExecutingOrdersUpdater' |
Oops, something went wrong.