-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add guidelines to landing page
- Loading branch information
1 parent
b5e00e3
commit fb66a5d
Showing
18 changed files
with
581 additions
and
539 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 |
---|---|---|
@@ -1,20 +1,25 @@ | ||
SECRET_KEY= | ||
# Copy this file to .env and fill in the values | ||
|
||
CDN_NAME= | ||
CDN_API_KEY= | ||
CDN_API_SECRET= | ||
# Generate a secrety key for Django and set it here. | ||
# You can use the following command to generate a secret key: | ||
# python3 -c "import secrets; print(secrets.token_urlsafe())" | ||
SECRET_KEY= | ||
|
||
# Set the following variables to the values of your database | ||
DB_HOST= | ||
DB_NAME= | ||
DB_USER= | ||
DB_PASSWORD= | ||
DB_PORT= | ||
|
||
# Set the following variables to the values of your Cloudinary account | ||
CDN_NAME= | ||
CDN_API_KEY= | ||
CDN_API_SECRET= | ||
|
||
# Set the following variables to the values of your SMTP server | ||
SMTP_HOST_USER= | ||
SMTP_HOST_PASSWORD= | ||
|
||
# Wether to run the application in test mode or not | ||
TEST= | ||
|
||
TWILIO_ACCOUNT_SID= | ||
TWILIO_AUTH_TOKEN= | ||
TWILIO_WPP_NUMBER= |
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,3 +1,2 @@ | ||
NODE_ENV=development | ||
AUTH_TOKEN= | ||
GTAG_ID= |
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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import React from "react"; | ||
import { Button, Card } from "flowbite-react"; | ||
import { IPublication } from "../api"; | ||
import dayjs from "dayjs"; | ||
import { ROUTES, useRouter } from "../routes"; | ||
|
||
interface Props { | ||
data: IPublication; | ||
} | ||
|
||
export function BlogPostPreview(props: Props) { | ||
const { data } = props; | ||
const { push } = useRouter(); | ||
|
||
return ( | ||
<Card | ||
className="max-w-sm mt-4" | ||
imgAlt={data.image_description} | ||
imgSrc={data.image} | ||
> | ||
<h5 className="text-2xl font-bold tracking-tight text-gray-900 dark:text-white"> | ||
{data.title} {dayjs(data.created_at).locale("pt-br").format("LLLL")} | ||
</h5> | ||
<p className="font-normal text-gray-700 dark:text-gray-400"> | ||
{getPreview(data)} | ||
</p> | ||
<Button onClick={() => push(ROUTES.BLOG + "/" + data.slug)}> | ||
Read more | ||
<svg | ||
className="-mr-1 ml-2 h-4 w-4" | ||
fill="currentColor" | ||
viewBox="0 0 20 20" | ||
xmlns="http://www.w3.org/2000/svg" | ||
> | ||
<path | ||
fillRule="evenodd" | ||
d="M10.293 3.293a1 1 0 011.414 0l6 6a1 1 0 010 1.414l-6 6a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-4.293-4.293a1 1 0 010-1.414z" | ||
clipRule="evenodd" | ||
/> | ||
</svg> | ||
</Button> | ||
</Card> | ||
); | ||
} | ||
|
||
function getPreview(data: IPublication) { | ||
const preview = data.description ? data.description : data.body; | ||
|
||
return preview.slice(0, 50); | ||
} |
Oops, something went wrong.