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

Merge main to release #228

Merged
merged 4 commits into from
Oct 16, 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
1 change: 1 addition & 0 deletions .env.development
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
VITE_API_BASE_URL=http://localhost:3000
VITE_CLERK_PUBLISHABLE_KEY=pk_test_b3B0aW1hbC1jaGlja2VuLTU3LmNsZXJrLmFjY291bnRzLmRldiQ
VITE_GOOGLE_REDIRECT_URL=https://optimal-chicken-57.clerk.accounts.dev/v1/oauth_callback
VITE_LOG_LEVEL=debug
2 changes: 1 addition & 1 deletion src/avs/AVSDetailsOperatorsTab.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ function AVSOperatorsList({ address, avsError, isAVSLoading, tvl }) {
className="size-16 cursor-pointer border-t border-outline bg-black/100 transition-colors hover:bg-default"
key={`promoted-operator-item-${i}`}
onClick={() =>
navigate(`/operators/${operator.address}`, {
navigate(`/operators/${operator.operator}`, {
state: { operator }
})
}
Expand Down
3 changes: 2 additions & 1 deletion src/home/OverviewStats.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ export default function OverviewStats({

const calculateEigenLayerTVL = () =>
eigenLayerTVL[eigenLayerTVL.length - 1].ethTVL +
eigenLayerTVL[eigenLayerTVL.length - 1].lstTVL;
eigenLayerTVL[eigenLayerTVL.length - 1].lstTVL +
eigenLayerTVL[eigenLayerTVL.length - 1].eigenTVL;

useEffect(() => {
const fetchOperators = async () => {
Expand Down
51 changes: 26 additions & 25 deletions src/onboarding/Login.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Button, Input } from '@nextui-org/react';
import { Button, Divider, Image, Input } from '@nextui-org/react';
import { Link, Navigate, useNavigate } from 'react-router-dom';
import { useSignIn, useUser } from '@clerk/clerk-react';
import { reduceState } from '../shared/helpers';
Expand Down Expand Up @@ -54,14 +54,13 @@ export default function Login() {
}
};

// const handleGoogleLogin = async () => {
// await signIn.authenticateWithRedirect({
// strategy: 'oauth_google',
// redirectUrl:
// 'https://hip-primate-84.clerk.accounts.dev/v1/oauth_callback',
// redirectUrlComplete: '/'
// });
// };
const handleGoogleLogin = async () => {
await signIn.authenticateWithRedirect({
strategy: 'oauth_google',
redirectUrl: import.meta.env.VITE_GOOGLE_REDIRECT_URL,
redirectUrlComplete: '/'
});
};

if (isSignedIn) {
return <Navigate to={'/'} />;
Expand All @@ -78,8 +77,6 @@ export default function Login() {
</p>
</div>

{/* <GoogleOneTap /> */}

<form
className="flex w-full flex-col items-center justify-center gap-y-5 rounded-lg border border-outline bg-content1 p-5 md:w-[31rem]"
onSubmit={handleSubmit(handleLogin)}
Expand Down Expand Up @@ -133,20 +130,24 @@ export default function Login() {
})}
/>

{/* <div className="flex w-full items-center gap-x-2">
<Divider className="w-[46.5%] bg-outline" />
<p>or</p>
<Divider className="w-[46.5%] bg-outline" />
</div> */}
{/* <Button
className="rounded-sm border border-outline"
fullWidth
onPress={handleGoogleLogin}
startContent={<Image src="/images/google.svg" />}
variant="bordered"
>
Continue with Google
</Button> */}
{localStorage.getItem('isGoogleOAuthEnabled') && (
<div className="flex w-full items-center gap-x-2">
<Divider className="w-[46.5%] bg-outline" />
<p>or</p>
<Divider className="w-[46.5%] bg-outline" />
</div>
)}
{localStorage.getItem('isGoogleOAuthEnabled') && (
<Button
className="rounded-sm border border-outline"
fullWidth
onPress={handleGoogleLogin}
startContent={<Image src="/images/google.svg" />}
variant="bordered"
>
Continue with Google
</Button>
)}

<Button
className="rounded-sm border border-secondary text-secondary hover:border-focus hover:text-focus"
Expand Down
73 changes: 37 additions & 36 deletions src/onboarding/Register.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Button, Checkbox, cn, Input } from '@nextui-org/react';
import { Button, Checkbox, cn, Divider, Image, Input } from '@nextui-org/react';
import { Link, Navigate, useNavigate } from 'react-router-dom';
import { useSignUp, useUser } from '@clerk/clerk-react';
import { OTPInput } from 'input-otp';
Expand All @@ -12,8 +12,8 @@ export default function Register() {
handleSubmit,
getValues,
setError,
// clearErrors,
// reset,
clearErrors,
reset,
formState: { errors }
} = useForm();
const { isLoaded: isClerkLoaded, signUp, setActive } = useSignUp();
Expand Down Expand Up @@ -90,23 +90,22 @@ export default function Register() {
}
};

// const handleGoogleLogin = async () => {
// reset();
// if (!getValues('terms')) {
// setError('terms', {
// message: 'Please accept terms and conditions',
// type: 'required'
// });
// return;
// }
// clearErrors('terms');
// await signUp.authenticateWithRedirect({
// strategy: 'oauth_google',
// redirectUrl:
// 'https://hip-primate-84.clerk.accounts.dev/v1/oauth_callback',
// redirectUrlComplete: '/'
// });
// };
const handleGoogleLogin = async () => {
reset();
if (!getValues('terms')) {
setError('terms', {
message: 'Please accept terms and conditions',
type: 'required'
});
return;
}
clearErrors('terms');
await signUp.authenticateWithRedirect({
strategy: 'oauth_google',
redirectUrl: import.meta.env.VITE_GOOGLE_REDIRECT_URL,
redirectUrlComplete: '/'
});
};

if (isSignedIn) {
return <Navigate to={'/'} />;
Expand Down Expand Up @@ -181,8 +180,6 @@ export default function Register() {
</p>
</div>

{/* <GoogleOneTap /> */}

<form
className="flex w-full flex-col items-center justify-center gap-y-5 rounded-lg border border-outline bg-content1 p-5 md:w-[31rem]"
onSubmit={handleSubmit(handleSignUp)}
Expand Down Expand Up @@ -236,21 +233,25 @@ export default function Register() {
})}
/>

{/* <div className="flex w-full items-center gap-x-2">
<Divider className="w-[46.5%] bg-outline" />
<p>or</p>
<Divider className="w-[46.5%] bg-outline" />
</div> */}
{localStorage.getItem('isGoogleOAuthEnabled') && (
<div className="flex w-full items-center gap-x-2">
<Divider className="w-[46.5%] bg-outline" />
<p>or</p>
<Divider className="w-[46.5%] bg-outline" />
</div>
)}

{/* <Button
className="rounded-sm border border-outline"
fullWidth
onPress={handleGoogleLogin}
startContent={<Image src="/images/google.svg" />}
variant="bordered"
>
Continue with Google
</Button> */}
{localStorage.getItem('isGoogleOAuthEnabled') && (
<Button
className="rounded-sm border border-outline"
fullWidth
onPress={handleGoogleLogin}
startContent={<Image src="/images/google.svg" />}
variant="bordered"
>
Continue with Google
</Button>
)}

<div className="flex w-full flex-col">
<Checkbox
Expand Down
33 changes: 32 additions & 1 deletion terraform/Amplify/main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
resource "aws_amplify_app" "main" {
name = "restaking-dashboard"
name = "restaking-dashboard-app"
repository = "https://github.com/NethermindEth/restaking-dashboard"

environment_variables = {
Expand All @@ -16,11 +16,21 @@ resource "aws_amplify_app" "main" {
status = "200"
target = "/index.html"
}

}

resource "aws_amplify_branch" "main" {
app_id = aws_amplify_app.main.id
branch_name = "main"
stage = "DEVELOPMENT"

enable_auto_build = false
}

# Release branch for production environment
resource "aws_amplify_branch" "release" {
app_id = aws_amplify_app.main.id
branch_name = "release/v0.1.0"
stage = "PRODUCTION"

enable_auto_build = false
Expand All @@ -37,6 +47,21 @@ resource "aws_amplify_domain_association" "main" {
branch_name = aws_amplify_branch.main.branch_name
prefix = "stage"
}

# add this for pre-production domain
# https://prod.restaking.info
sub_domain {
branch_name = aws_amplify_branch.release.branch_name
prefix = "prod"
}

# add this for production domain
# https://restaking.info
sub_domain {
branch_name = aws_amplify_branch.release.branch_name
prefix = ""
}

}


Expand All @@ -46,3 +71,9 @@ resource "aws_amplify_webhook" "stage" {
description = "stage"
}


resource "aws_amplify_webhook" "release" {
app_id = aws_amplify_app.main.id
branch_name = aws_amplify_branch.release.branch_name
description = "release"
}
8 changes: 8 additions & 0 deletions terraform/Amplify/output.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

output "aws_amplify_domain_association" {
value = aws_amplify_domain_association.main.sub_domain
}

output "aws_amplify_webhook"{
value = aws_amplify_webhook.stage.url
}