();
const [isApplied, setIsApplied] = useState(false);
const [open, setOpen] = React.useState(false);
const [studentId, setStudentId] = useState([]);
@@ -34,12 +34,14 @@ export default function business() {
setOpen(false);
};
+const queryBusiness:any = router.query.business
+
const getBusinessInformation = async () => {
const info = await db
.collection("Businesses")
- .doc(router.query.business)
+ .doc(queryBusiness)
.get();
- setBusinessInfo(info.data());
+ setBusinessInfo(info.data() as any);
};
const checkExistWhichCollection = async () => {
@@ -81,7 +83,7 @@ export default function business() {
};
const changeBusinessStatus = (e) => {
- db.collection("Businesses").doc(router.query.business).set(
+ db.collection("Businesses").doc(queryBusiness).set(
{
applyStatus: businessStatus,
},
@@ -93,7 +95,7 @@ export default function business() {
const applyWork = async () => {
const appliedData = await db
.collection("Businesses")
- .doc(router.query.business)
+ .doc(queryBusiness)
.collection("isApplied")
.where("studentId", "==", auth.currentUser.uid)
.get();
@@ -102,7 +104,7 @@ export default function business() {
if (zeroOrOne === 0) {
await db
.collection("Businesses")
- .doc(router.query.business)
+ .doc(queryBusiness)
.collection("isApplied")
.doc(auth.currentUser.uid)
.set(
@@ -117,7 +119,7 @@ export default function business() {
.collection("Students")
.doc(auth.currentUser.uid)
.collection("apply")
- .doc(router.query.business)
+ .doc(queryBusiness)
.set(
{
businessId: router.query.business,
@@ -150,7 +152,7 @@ export default function business() {
setOpen(true);
const studentId = await db
.collection("Businesses")
- .doc(router.query.business)
+ .doc(queryBusiness)
.collection("isApplied")
.get();
const _studentId = [];
@@ -178,7 +180,9 @@ export default function business() {
) : (
<>
- |
+ |
{businessInfo.imageURL && (
-
+
募集状況
@@ -273,7 +279,7 @@ export default function business() {
>
{studentId.map((student, index) => {
diff --git a/src/pages/individual-pages/company/[company].jsx b/src/pages/individual-pages/company/[company].tsx
similarity index 93%
rename from src/pages/individual-pages/company/[company].jsx
rename to src/pages/individual-pages/company/[company].tsx
index 77c538d..095204e 100644
--- a/src/pages/individual-pages/company/[company].jsx
+++ b/src/pages/individual-pages/company/[company].tsx
@@ -26,8 +26,8 @@ export default function company() {
const router = useRouter();
const isReady = router.isReady;
const [loading, setLoading] = useState(false);
- const [companyInfo, setCompanyInfo] = useState();
- const [companyBusinessInfo, setCompanyBusinessInfo] = useState();
+ const [companyInfo, setCompanyInfo] = useState();
+ const [companyBusinessInfo, setCompanyBusinessInfo] = useState();
const [companyBusinessImageUrl, setCompanyBusinessImageUrl] = useState([]);
// const [exists, setExists] = useState(false);
const [open, setOpen] = React.useState(false);
@@ -44,17 +44,19 @@ export default function company() {
p: 4,
};
+ const queryCompany:any = router.query.company
+
const getCompanyInformation = async () => {
const info = await db
.collection("Companies")
- .doc(router.query.company)
+ .doc(queryCompany)
.get();
- setCompanyInfo(info.data());
+ setCompanyInfo(info.data() as any);
};
const getCompanyBusinessInformation = async () => {
const _companyBusinessInfo = [];
- const _businessInfoWithSub = [];
+ const _businessInfoWithSub:any = [];
const businessInfo = await db
.collection("Businesses")
@@ -200,15 +202,21 @@ export default function company() {
>
{business.business}
-
+
{business.message}
-
+
{business.location}
-
+
{`${business.reward}/月`}
diff --git a/src/pages/individual-pages/student/[student].jsx b/src/pages/individual-pages/student/[student].tsx
similarity index 96%
rename from src/pages/individual-pages/student/[student].jsx
rename to src/pages/individual-pages/student/[student].tsx
index 2c25667..8e97617 100644
--- a/src/pages/individual-pages/student/[student].jsx
+++ b/src/pages/individual-pages/student/[student].tsx
@@ -23,21 +23,23 @@ export default function student() {
const router = useRouter();
const isReady = router.isReady;
const [loading, setLoading] = useState(false);
- const [studentInfo, setStudentInfo] = useState();
+ const [studentInfo, setStudentInfo] = useState();
const [studentBusinessInfo, setStudentBusinessInfo] = useState([]);
+ const queryStudent:any = router.query.student
+
const getStudentInformation = async () => {
const info = await db
.collection("Students")
- .doc(router.query.student)
+ .doc(queryStudent)
.get();
- setStudentInfo(info.data());
+ setStudentInfo(info.data()as any);
};
const getStudentAppliedBusinessData = async () => {
const appliedBusinessInfo = await db
.collection("Students")
- .doc(router.query.student)
+ .doc(queryStudent)
.collection("apply")
.get();
const _appliedBusinessInfo = [];
diff --git a/src/store/userState.js b/src/store/userState.ts
similarity index 68%
rename from src/store/userState.js
rename to src/store/userState.ts
index 0d28534..8ce8b76 100644
--- a/src/store/userState.js
+++ b/src/store/userState.ts
@@ -1,6 +1,6 @@
import { atom } from "recoil";
-export const userState = atom({
+export const userState = atom({
key: "userState",
default: { uid: "" },
});
diff --git a/src/tsconfig.json b/src/tsconfig.json
new file mode 100644
index 0000000..08a5c96
--- /dev/null
+++ b/src/tsconfig.json
@@ -0,0 +1,31 @@
+{
+ "compilerOptions": {
+ "target": "es5",
+ "lib": [
+ "dom",
+ "dom.iterable",
+ "esnext"
+ ],
+ "allowJs": true,
+ "skipLibCheck": true,
+ "strict": false,
+ "forceConsistentCasingInFileNames": true,
+ "noEmit": true,
+ "incremental": true,
+ "esModuleInterop": true,
+ "module": "esnext",
+ "moduleResolution": "node",
+ "resolveJsonModule": true,
+ "isolatedModules": true,
+ "jsx": "preserve"
+ },
+ "include": [
+ "next-env.d.ts",
+ "**/*.ts",
+ "**/*.tsx",
+
+ ],
+ "exclude": [
+ "node_modules"
+ ]
+}
diff --git a/tsconfig.json b/tsconfig.json
new file mode 100644
index 0000000..da5058d
--- /dev/null
+++ b/tsconfig.json
@@ -0,0 +1,29 @@
+{
+ "compilerOptions": {
+ "target": "es5",
+ "lib": [
+ "dom",
+ "dom.iterable",
+ "esnext"
+ ],
+ "allowJs": true,
+ "skipLibCheck": true,
+ "strict": false,
+ "forceConsistentCasingInFileNames": true,
+ "noEmit": true,
+ "esModuleInterop": true,
+ "module": "esnext",
+ "moduleResolution": "node",
+ "resolveJsonModule": true,
+ "isolatedModules": true,
+ "jsx": "preserve"
+ },
+ "include": [
+ "next-env.d.ts",
+ "**/*.ts",
+ "**/*.tsx"
+, "src/next.config.js", "src/_document.js", "src/_app.js", "src/theme.js" ],
+ "exclude": [
+ "node_modules"
+ ]
+}
\ No newline at end of file
diff --git a/yarn.lock b/yarn.lock
index 060bf77..0eb912a 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1144,6 +1144,11 @@
resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.7.tgz#36820945061326978c42a01e56b61cd223dfdc42"
integrity sha512-QB5D2sqfSjCmTuWcBWyJ+/44bcjO7VbjSbOE0ucoVbAsSNQc4Lt6QkgkVXkTDwkL4z/beecZNDvVX15D4P8Jbw==
+"@types/node@^16.11.12":
+ version "16.11.12"
+ resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.12.tgz#ac7fb693ac587ee182c3780c26eb65546a1a3c10"
+ integrity sha512-+2Iggwg7PxoO5Kyhvsq9VarmPbIelXP070HMImEpbtGCoyWNINQj4wzjbQCXzdHTRXnqufutJb5KAURZANNBAw==
+
"@types/prop-types@*", "@types/prop-types@^15.7.4":
version "15.7.4"
resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.4.tgz#fcf7205c25dff795ee79af1e30da2c9790808f11"
@@ -1159,6 +1164,13 @@
resolved "https://registry.yarnpkg.com/@types/range-parser/-/range-parser-1.2.4.tgz#cd667bcfdd025213aafb7ca5915a932590acdcdc"
integrity sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==
+"@types/react-dom@^17.0.11":
+ version "17.0.11"
+ resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-17.0.11.tgz#e1eadc3c5e86bdb5f7684e00274ae228e7bcc466"
+ integrity sha512-f96K3k+24RaLGVu/Y2Ng3e1EbZ8/cVJvypZWd7cy0ofCBaf2lcM46xNhycMZ2xGwbBjRql7hOlZ+e2WlJ5MH3Q==
+ dependencies:
+ "@types/react" "*"
+
"@types/react-is@^16.7.1 || ^17.0.0":
version "17.0.3"
resolved "https://registry.yarnpkg.com/@types/react-is/-/react-is-17.0.3.tgz#2d855ba575f2fc8d17ef9861f084acc4b90a137a"
@@ -1182,6 +1194,15 @@
"@types/scheduler" "*"
csstype "^3.0.2"
+"@types/react@^17.0.37":
+ version "17.0.37"
+ resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.37.tgz#6884d0aa402605935c397ae689deed115caad959"
+ integrity sha512-2FS1oTqBGcH/s0E+CjrCCR9+JMpsu9b69RTFO+40ua43ZqP5MmQ4iUde/dMjWR909KxZwmOQIFq6AV6NjEG5xg==
+ dependencies:
+ "@types/prop-types" "*"
+ "@types/scheduler" "*"
+ csstype "^3.0.2"
+
"@types/scheduler@*":
version "0.16.2"
resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.2.tgz#1a62f89525723dde24ba1b01b092bf5df8ad4d39"
@@ -6881,6 +6902,11 @@ typedarray-to-buffer@^3.1.5:
dependencies:
is-typedarray "^1.0.0"
+typescript@^4.5.3:
+ version "4.5.3"
+ resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.5.3.tgz#afaa858e68c7103317d89eb90c5d8906268d353c"
+ integrity sha512-eVYaEHALSt+s9LbvgEv4Ef+Tdq7hBiIZgii12xXJnukryt3pMgJf6aKhoCZ3FWQsu6sydEnkg11fYXLzhLBjeQ==
+
unbox-primitive@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/unbox-primitive/-/unbox-primitive-1.0.1.tgz#085e215625ec3162574dc8859abee78a59b14471"
@@ -7305,6 +7331,11 @@ yargs@^16.1.1:
y18n "^5.0.5"
yargs-parser "^20.2.2"
+yarn@^1.22.17:
+ version "1.22.17"
+ resolved "https://registry.yarnpkg.com/yarn/-/yarn-1.22.17.tgz#bf910747d22497b573131f7341c0e1d15c74036c"
+ integrity sha512-H0p241BXaH0UN9IeH//RT82tl5PfNraVpSpEoW+ET7lmopNC61eZ+A+IDvU8FM6Go5vx162SncDL8J1ZjRBriQ==
+
yocto-queue@^0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b"
|