This repository has been archived by the owner on Jul 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Patch - Dokum (#93) * Add dokum page * Integerate dokum page backend * Add dokum swiper thumbs * Add style for active dokum * Add back button * Improve styling * Improve style * Add download functionality * Add video dokum * Fix dokum api slug search & handle empty video * Add dokumentasi lainnya section * Make share button functionable on dokum page * Fix photo error download * Fix error download video * Add decoration * Refactor dokum lainnya Co-authored-by: marcellinuselbert11 <[email protected]> Co-authored-by: Marcellinus Elbert <[email protected]> * Fix padding on dokum lainnya section * Make sharelink more versatile to any link routing * Change share click handler * Make picture clickable on dokum card Co-authored-by: Naufal Weise <[email protected]> Co-authored-by: Marcellinus Elbert <[email protected]>
- Loading branch information
1 parent
6cc5b9f
commit 8ec1baf
Showing
15 changed files
with
561 additions
and
138 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
import Link from "next/link"; | ||
import { | ||
Card, | ||
BodyResponsive, | ||
HeaderResponsive, | ||
useWindowSize, | ||
ShareLinkToClipboard, | ||
} from "@components"; | ||
import { Dokumentasi } from "@models"; | ||
import { PhotographIcon, PlayIcon } from "@heroicons/react/outline"; | ||
|
||
type DokumentasiCardProps = { | ||
dokumentasi: Dokumentasi; | ||
index: number; | ||
className?: string; | ||
}; | ||
|
||
export const DokumentasiCard = ({ | ||
dokumentasi, | ||
index, | ||
className, | ||
}: DokumentasiCardProps) => { | ||
const windowSize = useWindowSize(); | ||
const { width } = useWindowSize(); | ||
|
||
const truncate = (input: string) => { | ||
const words = width >= 1280 ? 50 : 35; | ||
return input.length > words ? `${input.substring(0, words)}...` : input; | ||
}; | ||
|
||
return ( | ||
<Card | ||
preset="light" | ||
className={`w-full ${className} desktop:h-[380px] tablet:h-[280px] mobile:h-[250px] desktop:p-4 tablet:p-[14px] mobile:p-4 relative`} | ||
key={index} | ||
> | ||
<Link href={`/dokumentasi/${dokumentasi.slug}`}> | ||
<a> | ||
<div | ||
className="desktop:h-36 tablet:h-[40%] mobile:h-[55%] w-[90%] bg-cover bg-center opacity-80 absolute desktop:left-[15px] tablet:left-[11px] rounded-[9px] " | ||
style={{ | ||
backgroundImage: `url(${dokumentasi.photoUrls[0]})`, | ||
}} | ||
/> | ||
<div className="desktop:pt-40 tablet:pt-32 mobile:pt-40"> | ||
<BodyResponsive | ||
windowSize={windowSize} | ||
preset="p2" | ||
presetTablet="p2" | ||
presetDesktop="p2" | ||
className="text-denim-dark font-bold " | ||
> | ||
{dokumentasi.date} | ||
</BodyResponsive> | ||
<HeaderResponsive | ||
windowSize={windowSize} | ||
preset="h7" | ||
presetTablet="h6" | ||
presetDesktop="h5" | ||
className="tablet:block mobile:hidden" | ||
> | ||
{truncate(dokumentasi.title)} | ||
</HeaderResponsive> | ||
</div>{" "} | ||
</a> | ||
</Link> | ||
<div className="mt-3 flex w-[85%] absolute justify-between bottom-4"> | ||
<div className="flex items-center desktop:gap-2 tablet:gap-0.5 mobile:gap-2"> | ||
<BodyResponsive | ||
windowSize={windowSize} | ||
preset="p3" | ||
presetTablet="p2" | ||
presetDesktop="p2" | ||
className="text-cerulean font-bold " | ||
> | ||
{dokumentasi.photoUrls.length} | ||
</BodyResponsive> | ||
<PhotographIcon className="w-5 h-5 stroke-cerulean" /> | ||
</div> | ||
<div className="flex items-center desktop:gap-2 tablet:gap-0.5 mobile:gap-2"> | ||
<BodyResponsive | ||
windowSize={windowSize} | ||
preset="p3" | ||
presetTablet="p2" | ||
presetDesktop="p2" | ||
className="text-cerulean font-bold " | ||
> | ||
{dokumentasi.videoUrls.length} | ||
</BodyResponsive> | ||
<PlayIcon className="w-5 h-5 stroke-cerulean" /> | ||
</div> | ||
<div className="flex items-center desktop:gap-2 tablet:gap-0.5 mobile:gap-2"> | ||
{/* <ShareIcon className="w-5 h-5 stroke-denim-dark" /> */} | ||
<ShareLinkToClipboard | ||
className="right-0 top-1" | ||
link={"dokumentasi/" + dokumentasi.slug} | ||
/> | ||
</div> | ||
</div> | ||
</Card> | ||
); | ||
}; |
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export * from "./Card"; | ||
export * from "./DonationCard"; | ||
export * from "./DokumentasiCard" |
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
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 |
---|---|---|
@@ -1,17 +1,35 @@ | ||
const withReactSvg = require("next-react-svg"); | ||
const path = require("path"); | ||
|
||
const apiUrl = new URL(process.env.NEXT_PUBLIC_API_STRAPI); | ||
|
||
module.exports = withReactSvg({ | ||
images: { | ||
domains: ["localhost", "api.depokkita.com"], | ||
}, | ||
include: path.resolve(__dirname, "public/assets"), | ||
images: { | ||
domains: ["api.depokkita.com", "localhost", "res.cloudinary.com"], | ||
}, | ||
experimental: { | ||
esmExternals: false, | ||
}, | ||
webpack(config, options) { | ||
return config; | ||
}, | ||
images: { | ||
domains: [ | ||
apiUrl.host, | ||
"localhost", | ||
"api.depokkita.com", | ||
"res.cloudinary.com", | ||
], | ||
}, | ||
async headers() { | ||
return [ | ||
{ | ||
source: "/:path*", | ||
headers: [ | ||
{ | ||
key: "Content-Security-Policy", | ||
value: `frame-ancestors 'self' https://api.depokkita.com;`, | ||
}, | ||
], | ||
}, | ||
]; | ||
}, | ||
}); |
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.