Refactor code for readability and order

Made several changes across different files primarily focusing on readability. Arranged CSS classes in a standardized order for easier reading and maintenance. Arranged and formatted import lines, function declarations, and component return statements for legibility. Removed unnecessary React imports in some files.
This commit is contained in:
gbuomprisco
2024-06-21 17:58:20 +08:00
parent 8c929e6685
commit 9294e1c823
15 changed files with 26 additions and 41 deletions

View File

@@ -1,5 +1,3 @@
import * as React from 'react';
export function BodyStyle() {
return (
<style>

View File

@@ -1,5 +1,4 @@
import { Container } from '@react-email/components';
import * as React from 'react';
export function EmailContent(
props: React.PropsWithChildren<{
@@ -9,7 +8,7 @@ export function EmailContent(
return (
<Container
className={
'rounded-xl my-[8px] px-[24px] py-[12px] mx-auto border border-solid border-[#eeeeee] ' +
'mx-auto my-[8px] rounded-xl border border-solid border-[#eeeeee] px-[24px] py-[12px] ' +
props.className || ''
}
>

View File

@@ -1,5 +1,4 @@
import { Button } from '@react-email/components';
import * as React from 'react';
export function CtaButton(
props: React.PropsWithChildren<{
@@ -8,7 +7,7 @@ export function CtaButton(
) {
return (
<Button
className="w-full bg-[#000000] rounded text-white text-[14px] font-semibold no-underline text-center py-3"
className="w-full rounded bg-[#000000] py-3 text-center text-[14px] font-semibold text-white no-underline"
href={props.href}
>
{props.children}

View File

@@ -1,10 +1,9 @@
import { Container, Text } from '@react-email/components';
import * as React from 'react';
export function EmailFooter(props: React.PropsWithChildren) {
return (
<Container>
<Text className="text-[12px] leading-[24px] text-gray-300 px-4">
<Text className="px-4 text-[12px] leading-[24px] text-gray-300">
{props.children}
</Text>
</Container>

View File

@@ -1,10 +1,5 @@
import { Container } from '@react-email/components';
import * as React from 'react';
export function EmailHeader(props: React.PropsWithChildren) {
return (
<Container>
{props.children}
</Container>
);
return <Container>{props.children}</Container>;
}

View File

@@ -1,9 +1,8 @@
import * as React from 'react';
import { Heading } from '@react-email/components';
export function EmailHeading(props: React.PropsWithChildren) {
return (
<Heading className="text-black font-sans tracking-tight text-[20px] font-normal p-0 mx-0">
<Heading className="mx-0 p-0 font-sans text-[20px] font-normal tracking-tight text-black">
{props.children}
</Heading>
);

View File

@@ -1,5 +1,4 @@
import { Container } from '@react-email/components';
import * as React from 'react';
export function EmailWrapper(
props: React.PropsWithChildren<{
@@ -21,7 +20,7 @@ export function EmailWrapper(
backgroundColor: '#fff',
margin: 'auto',
}}
className={'my-[36px] mx-auto px-4 ' + props.className || ''}
className={'mx-auto my-[36px] px-4 ' + props.className || ''}
>
{props.children}
</Container>