Skip to content

Commit

Permalink
Merge pull request #19 from VortexExpansion/main
Browse files Browse the repository at this point in the history
custom prettier fix
  • Loading branch information
HisashiHasebe authored Mar 8, 2024
2 parents f5add5a + 28db9ec commit c1ee6b9
Show file tree
Hide file tree
Showing 20 changed files with 348 additions and 311 deletions.
10 changes: 4 additions & 6 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{
"semi": false,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "all"
}

"semi": false,
"tabWidth": 2,
"trailingComma": "all"
}
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
}
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"eslint": "latest",
"eslint-config-next": "latest",
"postcss": "latest",
"prettier": "^3.2.4",
"prettier": "^3.2.5",
"sass": "^1.69.5",
"tailwindcss": "latest"
}
Expand Down
73 changes: 37 additions & 36 deletions src/app/(pages)/(SigleColumn)/login/page.jsx
Original file line number Diff line number Diff line change
@@ -1,43 +1,41 @@
"use client";

import { useUser } from "@/components/common/userContext";
import { login } from "@/components/common/fetchData";
import { useRef } from "react";
import { useRouter } from "next/navigation";
import Link from "next/link";
import Breadcrumb from "@/components/common/Breadcrumb";
import PageTitle from "@/components/common/PageTitle";
import { getLabels } from "@/components/common/fetchData";
import AlertError from "@/components/ui/AlertError";
import { useState } from "react";
"use client"

import { useUser } from "@/components/common/userContext"
import { login } from "@/components/common/fetchData"
import { useRef } from "react"
import { useRouter } from "next/navigation"
import Link from "next/link"
import Breadcrumb from "@/components/common/Breadcrumb"
import PageTitle from "@/components/common/PageTitle"
import { getLabels } from "@/components/common/fetchData"
import AlertError from "@/components/ui/AlertError"
import { useState } from "react"

export default function Login() {
const email = useRef("");
const password = useRef("");
const { user, loading, storeUser } = useUser();
const router = useRouter();
const contentDirectory = getLabels();
const content = contentDirectory.login;
const [alert, setAlert] = useState(false);
const email = useRef("")
const password = useRef("")
const { user, loading, storeUser } = useUser()
const router = useRouter()
const contentDirectory = getLabels()
const content = contentDirectory.login
const [alert, setAlert] = useState(false)

const handleChange = () => {
setAlert(false);
};
setAlert(false)
}

const handleLogin = async (event) => {
event.preventDefault();
const user = await login(email.current.value, password.current.value);
event.preventDefault()
const user = await login(email.current.value, password.current.value)

if (user) {
setAlert(false);
storeUser(user);
router.push("member/mypage");
}
else{
setAlert(true);
setAlert(false)
storeUser(user)
router.push("member/mypage")
} else {
setAlert(true)
}
};
}

return (
<div className="l-container">
Expand All @@ -50,9 +48,14 @@ export default function Login() {
) : user ? (
<div>You have already logged in.</div>
) : (
<form className="c-form c-box" onSubmit={handleLogin} onChange={handleChange}>

{alert && <AlertError message="メールアドレスまたはパスワードが間違っています。" />}
<form
className="c-form c-box"
onSubmit={handleLogin}
onChange={handleChange}
>
{alert && (
<AlertError message="メールアドレスまたはパスワードが間違っています。" />
)}
<div className="c-form-group">
<label htmlFor="email" className="c-form-label">
メールアドレス
Expand Down Expand Up @@ -86,10 +89,8 @@ export default function Login() {
</div>
</form>
)}

</div>
</div>

</div>
);
)
}
71 changes: 38 additions & 33 deletions src/app/(pages)/(SigleColumn)/register/page.jsx
Original file line number Diff line number Diff line change
@@ -1,62 +1,68 @@
"use client";
"use client"

import Breadcrumb from "@/components/common/Breadcrumb";
import PageTitle from "@/components/common/PageTitle";
import { getLabels } from "@/components/common/fetchData";
import Link from "next/link";
import { useRef, useState } from "react";
import { register } from "@/components/common/fetchData";
import { useUser } from "@/components/common/userContext";
import { useRouter } from "next/navigation";
import AlertError from "@/components/ui/AlertError";
import Breadcrumb from "@/components/common/Breadcrumb"
import PageTitle from "@/components/common/PageTitle"
import { getLabels } from "@/components/common/fetchData"
import Link from "next/link"
import { useRef, useState } from "react"
import { register } from "@/components/common/fetchData"
import { useUser } from "@/components/common/userContext"
import { useRouter } from "next/navigation"
import AlertError from "@/components/ui/AlertError"

export default function Register() {
const contentDirectory = getLabels();
const content = contentDirectory.register;
const { user, loading, storeUser } = useUser();
const router = useRouter();
const [alert, setAlert] = useState(false);
const contentDirectory = getLabels()
const content = contentDirectory.register
const { user, loading, storeUser } = useUser()
const router = useRouter()
const [alert, setAlert] = useState(false)

const name1 = useRef("");
const name2 = useRef("");
const email = useRef("");
const login_pwd = useRef("");
const name1 = useRef("")
const name2 = useRef("")
const email = useRef("")
const login_pwd = useRef("")

const handleChange = () => {
setAlert(false);
};
setAlert(false)
}

const handleRegister = async (event) => {
event.preventDefault();
event.preventDefault()

const user = await register(
name1.current.value,
name2.current.value,
email.current.value,
login_pwd.current.value
);
login_pwd.current.value,
)

if (user) {
setAlert(false);
storeUser(user);
router.push("member/mypage");
setAlert(false)
storeUser(user)
router.push("member/mypage")
} else {
setAlert(true);
setAlert(true)
}
};
}

return (
<div className="l-container">
<Breadcrumb paths={[{ label: content.text }]} />
<PageTitle content={content} />
<div className="l-container--small l-container--contents">
<form className="c-form c-box" onSubmit={handleRegister} onChange={handleChange}>
<form
className="c-form c-box"
onSubmit={handleRegister}
onChange={handleChange}
>
<div className="c-form-group u-text-align-center">
<p className="c-text--small">
<span className="c-form-label__required">*</span>は必須項目です。
</p>
</div>
{alert && <AlertError message="エントリー内容を再度ご確認ください。" />}
{alert && (
<AlertError message="エントリー内容を再度ご確認ください。" />
)}
<div className="c-form-group">
<label htmlFor="name1" className="c-form-label">
名前(姓)
Expand Down Expand Up @@ -110,8 +116,7 @@ export default function Register() {
に同意したこととなります。
</p>
</form>

</div>
</div>
);
)
}
24 changes: 12 additions & 12 deletions src/app/(pages)/(SigleColumn)/reminder/page.jsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
'use client'
"use client"

import Breadcrumb from '@/components/common/Breadcrumb'
import PageTitle from '@/components/common/PageTitle'
import { getLabels } from '@/components/common/fetchData'
import Link from 'next/link'
import { useRef, useState } from 'react'
import { reminder, reset } from '@/components/common/fetchData'
import AlertSuccess from '@/components/ui/AlertSuccess'
import Breadcrumb from "@/components/common/Breadcrumb"
import PageTitle from "@/components/common/PageTitle"
import { getLabels } from "@/components/common/fetchData"
import Link from "next/link"
import { useRef, useState } from "react"
import { reminder, reset } from "@/components/common/fetchData"
import AlertSuccess from "@/components/ui/AlertSuccess"

export default function Reminder({ searchParams }) {
const token = searchParams && searchParams.token ? searchParams.token : null
const contentDirectory = getLabels()
const content = contentDirectory.reminder
const mail = useRef('')
const temp_pwd = useRef('')
const login_pwd = useRef('')
const mail = useRef("")
const temp_pwd = useRef("")
const login_pwd = useRef("")

const [alert, setAlert] = useState(false)
const [alertMessage, setAlertMessage] = useState('')
const [alertMessage, setAlertMessage] = useState("")

const handleChange = () => {
setAlert(false)
Expand Down
14 changes: 6 additions & 8 deletions src/app/(pages)/(SingleColumnLarge)/layout.jsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
import Breadcrumb from "@/components/common/Breadcrumb";
import PageTitle from "@/components/common/PageTitle";
import Breadcrumb from "@/components/common/Breadcrumb"
import PageTitle from "@/components/common/PageTitle"

export default function SingleLargeLayout({ children }) {
const content = {
text: "プライバシーポリシー",
text_en: "PRIVACY POLICY"
};
text_en: "PRIVACY POLICY",
}
return (
<div className="l-container">
<Breadcrumb paths={[{ label: content.text }]} />
<PageTitle content={content} />
<div className="l-container--large l-container--contents">
{children}
</div>
<div className="l-container--large l-container--contents">{children}</div>
</div>
)
}
}
2 changes: 1 addition & 1 deletion src/app/(pages)/(SingleColumnLarge)/privacy/page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ export default function Privacy() {
改定日:2023年7月1日
</p>
</article>
);
)
}
28 changes: 15 additions & 13 deletions src/app/(pages)/(TwoColumn)/article/[id]/page.jsx
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
import DetailBody from '@/components/section/twoColumn/DetailBody'
import { getDetails, getAllContentList } from '@/components/common/fetchData'
import Banner from '@/components/common/Banner'
import Breadcrumb from '@/components/common/Breadcrumb'
import TagArea from '@/components/common/TagArea'
import TagKeyword from '@/components/common/TagKeyword'
import Feature from '@/components/section/feature/Feature'
import DetailBody from "@/components/section/twoColumn/DetailBody"
import { getDetails, getAllContentList } from "@/components/common/fetchData"
import Banner from "@/components/common/Banner"
import Breadcrumb from "@/components/common/Breadcrumb"
import TagArea from "@/components/common/TagArea"
import TagKeyword from "@/components/common/TagKeyword"
import Feature from "@/components/section/feature/Feature"

export async function generateStaticParams() {
const items = await getAllContentList()
const paramID = items.map((item) => ({
id: item.topics_id.toString(),
}))
return paramID;
return paramID
}

export default async function Food({ params }) {
const item = await getDetails(params.id);

const item = await getDetails(params.id)

const paths = [
{ href: `/article?topic=${item.contents_type_nm.toLowerCase()}`, label: item.contents_type_ext_col_01 },
{ label: '記事詳細' }
{
href: `/article?topic=${item.contents_type_nm.toLowerCase()}`,
label: item.contents_type_ext_col_01,
},
{ label: "記事詳細" },
]

return (
Expand All @@ -29,7 +31,7 @@ export default async function Food({ params }) {
<div className="l-container--col-2 c-article">
<div className="l-container--col-2__main">
<div>
<DetailBody data={item} params={params}/>
<DetailBody data={item} params={params} />
</div>
</div>
<div className="l-container--col-2__side">
Expand Down
Loading

0 comments on commit c1ee6b9

Please sign in to comment.