Skip to content
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 apps/nextjs/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const nextConfig = {
search: "",
},
{
// local
protocol: "https",
hostname: "d3t9degcpc8bgc.cloudfront.net",
},
Expand Down
11 changes: 10 additions & 1 deletion infra/nextjs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,15 @@ const NEXT_PUBLIC_BASE_URL =
? "https://d1a1w7ulyz8ubg.cloudfront.net"
: "http://localhost:3000";

const NEXT_PUBLIC_CDN_DOMAIN =
$app.stage === "production"
? "https://cdn.joinhomefront.org"
: $app.stage === "staging"
? "https://staging-cdn.joinhomefront.org"
: $app.stage === "development"
? "https://d3t9degcpc8bgc.cloudfront.net"
: "https://d3t9degcpc8bgc.cloudfront.net";

function getDomain(): NextjsArgs["domain"] | undefined {
switch ($app.stage) {
// case "development":
Expand Down Expand Up @@ -124,6 +133,7 @@ export const nextjs = new sst.aws.Nextjs("Web", {
],
environment: {
NEXT_PUBLIC_BASE_URL,
NEXT_PUBLIC_CDN_DOMAIN,
NEXT_PUBLIC_PROTOMAPS_API_KEY,
NEXT_PUBLIC_STRIPE_BILLING_RETURN_URL,
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY,
Expand All @@ -145,7 +155,6 @@ export const nextjs = new sst.aws.Nextjs("Web", {
STRIPE_HASH_KEY: stripeHashKey.value,
STRIPE_SECRET_KEY: stripeSecretKey.value,
STRIPE_WEBHOOK_SECRET: stripeWebhookSecret.value,
NEXT_PUBLIC_CDN_DOMAIN: "https://d3t9degcpc8bgc.cloudfront.net",
},
vpc,
});
Expand Down
18 changes: 12 additions & 6 deletions infra/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@ export const bucket = new sst.aws.Bucket("homefront-next-prod", {

export const cdnBucket = new sst.aws.Bucket("join-homefront", {
access: "public",
transform: {
bucket(args, opts) {
args.bucket = $app.stage === "production" ? "join-homefront" : undefined;
opts.import = $app.stage === "production" ? "join-homefront" : undefined;
},
},
});

export const cdn = new sst.aws.Cdn("CDN", {
Expand All @@ -21,6 +15,18 @@ export const cdn = new sst.aws.Cdn("CDN", {
domainName: cdnBucket.domain,
},
],
domain:
$app.stage === "production"
? {
name: "cdn.joinhomefront.org",
dns: sst.cloudflare.dns(),
}
: $app.stage === "staging"
? {
name: "staging-cdn.joinhomefront.org",
dns: sst.cloudflare.dns(),
}
: undefined,
defaultCacheBehavior: {
targetOriginId: cdnBucket.arn,
allowedMethods: ["GET", "HEAD", "OPTIONS"],
Expand Down
8 changes: 2 additions & 6 deletions packages/app/features/actions/RecommendedActionsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,7 @@ export function RecommendedActionsList() {
}
}, [isLoading, recommendedActions, hasAttemptedGeneration]);

if (
isLoading ||
generateRecommendedActions.isPending ||
!recommendedActions?.length
) {
if (isLoading || generateRecommendedActions.isPending) {
return (
<View className="flex-1 items-center justify-center p-4">
<ActivityIndicator />
Expand All @@ -57,7 +53,7 @@ export function RecommendedActionsList() {
)}
ListEmptyComponent={() => (
<Text className="py-4 text-left text-gray-500">
You don't have any recommended actions yet.
You don't have any recommended actions right now.
</Text>
)}
keyExtractor={(recommendedAction) =>
Expand Down
10 changes: 1 addition & 9 deletions packages/aws/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,7 @@ import { Resource } from "sst";

const BUCKET_NAME = Resource["join-homefront"].name;

const opts =
Resource.App.stage === "production"
? {
region: "us-east-2",
endpoint: `https://${BUCKET_NAME}.s3.us-east-2.amazonaws.com`,
}
: {};

const s3 = new S3Client(opts);
const s3 = new S3Client({});

const MIME_TO_EXT = {
"image/jpeg": ".jpg",
Expand Down
Loading