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

Run next/image codemod #1100

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
Binary file modified bun.lockb
Binary file not shown.
6 changes: 5 additions & 1 deletion src/app/harbor/battles/project-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,12 @@ export default function ProjectCard({
src={project.screenshot_url}
alt={`Screenshot of ${project.title}`}
fill
sizes="(max-width: 768px) 100vw, (max-width: 1200px) 50vw, 33vw"
className="object-cover"
sizes="(max-width: 768px) 100vw, (max-width: 1200px) 50vw, 33vw"
style={{
maxWidth: '100%',
height: 'auto',
}}
/>
</div>
)}
Expand Down
45 changes: 32 additions & 13 deletions src/app/harbor/shipyard/ships.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,14 @@ export default function Ships({
ship will start getting into matchups.
</p>
<div className="flex justify-center">
<Image src={ThinkingDino} alt="Thinking Dino" />
<Image
src={ThinkingDino}
alt="Thinking Dino"
style={{
maxWidth: '100%',
height: 'auto',
}}
/>
</div>
<div className="flex justify-end mt-5">
<Button
Expand Down Expand Up @@ -307,7 +314,6 @@ export default function Ships({
ref={canvasRef}
className="fixed w-screen left-0 top-0 pointer-events-none"
/>

{bareShips ? null : (
<motion.div
className="w-fit mx-auto mb-0 mt-3"
Expand All @@ -323,7 +329,6 @@ export default function Ships({
</Button>
</motion.div>
)}

{stagedShips.length === 0 ? null : (
<div className={`w-full mt-8`}>
{bareShips ? null : (
Expand Down Expand Up @@ -362,7 +367,6 @@ export default function Ships({
</div>
</div>
)}

<div className="w-full relative">
{shipChains && shippedShips.length > 0 ? (
<div className={`space-y-4 ${bareShips ? '' : 'mt-8'}`}>
Expand Down Expand Up @@ -398,7 +402,6 @@ export default function Ships({
</>
) : null}
</div>

<Modal
isOpen={newShipVisible && session}
close={() => setNewShipVisible(false)}
Expand All @@ -410,7 +413,6 @@ export default function Ships({
session={session}
/>
</Modal>

<Modal
isOpen={getChainFromAnyId(newUpdateShip?.id) && session}
close={() => setNewUpdateShip(null)}
Expand All @@ -423,7 +425,6 @@ export default function Ships({
session={session}
/>
</Modal>

<Modal
isOpen={!!selectedShip}
close={() => setSelectedShip(null)}
Expand All @@ -440,19 +441,22 @@ export default function Ships({
<div className="absolute top-0 left-0 right-0 h-48">
<Image
src={latestShip?.screenshotUrl}
style={{
maskImage:
'linear-gradient(to bottom, rgba(0, 0, 0, 1), rgba(0, 0, 0, 0))',
}}
alt={`Screenshot of ${latestShip?.title}`}
className="object-cover max-w-full rounded"
fill={true}
priority
unoptimized
sizes="4rem"
onError={({ target }) => {
target.src = NoImgBanner.src
}}
sizes="4rem"
style={{
maskImage:
'linear-gradient(to bottom, rgba(0, 0, 0, 1), rgba(0, 0, 0, 0))',

maxWidth: '100%',
height: 'auto',
}}
/>
</div>

Expand Down Expand Up @@ -639,6 +643,10 @@ export default function Ships({
alt=""
width={461}
height={11}
style={{
maxWidth: '100%',
height: 'auto',
}}
/>

<div>
Expand All @@ -654,6 +662,10 @@ export default function Ships({
alt=""
width={461}
height={11}
style={{
maxWidth: '100%',
height: 'auto',
}}
/>

{latestShip?.feedback && (
Expand All @@ -675,6 +687,10 @@ export default function Ships({
alt=""
width={461}
height={11}
style={{
maxWidth: '100%',
height: 'auto',
}}
/>
</>
)}
Expand All @@ -698,6 +714,10 @@ export default function Ships({
width={400}
height={100}
className="mx-auto object-cover mt-2"
style={{
maxWidth: '100%',
height: 'auto',
}}
/>
</div>
) : (
Expand All @@ -719,7 +739,6 @@ export default function Ships({
</div>
</div>
</Modal>

<Modal isOpen={!!errorModal} close={() => setErrorModal(undefined)}>
<p className="text-3xl mb-4">Arrrr! Something broke.</p>
<p className="mb-12">{errorModal}</p>
Expand Down
5 changes: 4 additions & 1 deletion src/app/harbor/shop/shop-item-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ export const ShopItemComponent = ({
alt=""
width={461}
height={11}
style={{
maxWidth: '100%',
height: 'auto',
}}
/>

{item.limited_qty && (
Expand Down Expand Up @@ -165,7 +169,6 @@ export const ShopItemComponent = ({
Close
</Button>
</Modal>

<Card
onClick={(e) => {
if (e.target.tagName !== 'BUTTON' && e.target.tagName !== 'FORM') {
Expand Down
11 changes: 9 additions & 2 deletions src/app/harbor/signpost/best-ships.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export default function BestShips() {
<h2 className="mt-8 font-heading text-2xl font-bold mb-4 text-center">
Best ships this week
</h2>

{bestShips ? (
<div className="flex gap-4 overflow-x-scroll">
{bestShips.map((partialShip: any, idx: number) => {
Expand All @@ -32,7 +31,15 @@ export default function BestShips() {
msg={`${partialShip.payout} doubloons`}
classes="bg-white/15 text-white"
glyphImage={
<Image src={DoubloonsImage} alt="Doubloons" height={20} />
<Image
src={DoubloonsImage}
alt="Doubloons"
height={20}
style={{
maxWidth: '100%',
height: 'auto',
}}
/>
}
/>
<div className="flex gap-3">
Expand Down
21 changes: 18 additions & 3 deletions src/app/harbor/signpost/wakatime-setup-instructions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ export default function WakatimeSetupInstructions({
</div>
</div>
</div>

<AnimatePresence>
{open ? (
<motion.div
Expand All @@ -64,7 +63,15 @@ export default function WakatimeSetupInstructions({
msg="Doubloons"
color="green"
glyphImage={
<Image src={DoubloonsImage} alt="Doubloons" height={20} />
<Image
src={DoubloonsImage}
alt="Doubloons"
height={20}
style={{
maxWidth: '100%',
height: 'auto',
}}
/>
}
/>{' '}
you get when your projects are voted on in the{' '}
Expand All @@ -76,7 +83,15 @@ export default function WakatimeSetupInstructions({
msg="Doubloons"
color="green"
glyphImage={
<Image src={DoubloonsImage} alt="Doubloons" height={20} />
<Image
src={DoubloonsImage}
alt="Doubloons"
height={20}
style={{
maxWidth: '100%',
height: 'auto',
}}
/>
}
/>{' '}
can be exchnged for items in the{' '}
Expand Down
72 changes: 54 additions & 18 deletions src/app/marketing/components/ScrollShop.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,14 @@ export default function ScrollShop() {
<Image
src="https://cloud-a823iqif6-hack-club-bot.vercel.app/0image.png"
alt="Photo 1"
layout="responsive"
width={100}
height={100}
objectFit="cover"
sizes="100vw"
style={{
width: '100%',
height: 'auto',
objectFit: 'cover',
}}
/>
</div>
<div
Expand All @@ -33,10 +37,14 @@ export default function ScrollShop() {
<Image
src="https://cloud-djbef06tx-hack-club-bot.vercel.app/0image.png"
alt="Photo 2"
layout="responsive"
width={100}
height={100}
objectFit="cover"
sizes="100vw"
style={{
width: '100%',
height: 'auto',
objectFit: 'cover',
}}
/>
</div>
<div
Expand All @@ -46,10 +54,14 @@ export default function ScrollShop() {
<Image
src="https://cloud-1e0x3bwfz-hack-club-bot.vercel.app/0image.png"
alt="Photo 3"
layout="responsive"
width={100}
height={100}
objectFit="cover"
sizes="100vw"
style={{
width: '100%',
height: 'auto',
objectFit: 'cover',
}}
/>
</div>
<div
Expand All @@ -59,10 +71,14 @@ export default function ScrollShop() {
<Image
src="https://cloud-d8js788lz-hack-club-bot.vercel.app/0image.png"
alt="Photo 4"
layout="responsive"
width={100}
height={100}
objectFit="cover"
sizes="100vw"
style={{
width: '100%',
height: 'auto',
objectFit: 'cover',
}}
/>
</div>
<div
Expand All @@ -72,10 +88,14 @@ export default function ScrollShop() {
<Image
src="https://noras-secret-cdn.hackclub.dev/shop/raspberry_pi_5.png"
alt="Photo 5"
layout="responsive"
width={100}
height={100}
objectFit="cover"
sizes="100vw"
style={{
width: '100%',
height: 'auto',
objectFit: 'cover',
}}
/>
</div>
<div
Expand All @@ -85,10 +105,14 @@ export default function ScrollShop() {
<Image
src="https://noras-secret-cdn.hackclub.dev/shop/gh_miir_backpack.png"
alt="Photo 5"
layout="responsive"
width={100}
height={100}
objectFit="cover"
sizes="100vw"
style={{
width: '100%',
height: 'auto',
objectFit: 'cover',
}}
/>
</div>
<div
Expand All @@ -98,10 +122,14 @@ export default function ScrollShop() {
<Image
src="https://noras-secret-cdn.hackclub.dev/shop/bambu_a1_mini.png"
alt="Photo 5"
layout="responsive"
width={100}
height={100}
objectFit="cover"
sizes="100vw"
style={{
width: '100%',
height: 'auto',
objectFit: 'cover',
}}
/>
</div>
<div
Expand All @@ -111,10 +139,14 @@ export default function ScrollShop() {
<Image
src="https://noras-secret-cdn.hackclub.dev/shop/ipad.png"
alt="Photo 5"
layout="responsive"
width={100}
height={100}
objectFit="cover"
sizes="100vw"
style={{
width: '100%',
height: 'auto',
objectFit: 'cover',
}}
/>
</div>
<div
Expand All @@ -124,10 +156,14 @@ export default function ScrollShop() {
<Image
src="https://noras-secret-cdn.hackclub.dev/shop/fw_13.png"
alt="Photo 5"
layout="responsive"
width={100}
height={100}
objectFit="cover"
sizes="100vw"
style={{
width: '100%',
height: 'auto',
objectFit: 'cover',
}}
/>
</div>
</Marquee>
Expand Down
Loading
Loading