Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hosting #349

Open
wants to merge 7 commits into
base: thambara
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions dear-diary/.firebase/hosting.YnVpbGQ.cache
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
asset-manifest.json,1703009562633,87c928384c0064153c5b5a79ce1fabbafd0329ccff5c3d190d24ca20781ad0fe
favicon.ico,1701879327313,27edce7be5922cf0bef7d4136f69b5bfbdd5bf8c13c7b026f71187d41a00aa7d
index.html,1703009562633,b5ec86cdc24508af78e258379facbb04693b71772e06b7e466c80aed4dcc5133
manifest.json,1701879327314,4368aeaf848ae2e048765562c289452f33ad2a175c4b1951ea8bdf2ada0d5b10
robots.txt,1701879327314,b2090cf9761ef60aa06e4fab97679bd43dfa5e5df073701ead5879d7c68f1ec5
static/css/main.9c6b28c8.css,1703009562641,1edf76c00632245ad1bf38b355bd4bbdee2a01800c4b9c6eb43fec31b3c0fd77
static/css/main.9c6b28c8.css.map,1703009562641,9dddbe352e71eafb9c0e5c826cdf1d273fe1df8f944d031deaf121498a45d9cd
static/js/787.97a755d5.chunk.js,1703009562641,80b29505546cb82bbae49a4595eb07131d17e7959ccd5453239d7652d6e6e308
static/js/787.97a755d5.chunk.js.map,1703009562642,b102309d3478fab86053fcf07fc925203c452b3b7eb42a01f99f5932bfaff424
static/js/main.f465f8af.js,1703009562641,099f43abe687d2c5b6fa534d363329104dfdd430aa3190eece1a850958122beb
static/js/main.f465f8af.js.LICENSE.txt,1703009562641,d31ce7e59ec7e7ef7af40ee3985d2dbf9aaee26a52023476fc98d981856f4ada
static/js/main.f465f8af.js.map,1703009562643,e54ceba0db9d88b625266b2693e87f35d8c0b8f399d97a5e80d6747118dc4b6d
5 changes: 5 additions & 0 deletions dear-diary/.firebaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"projects": {
"default": "dear-diary-emailusername-79cfe"
}
}
18 changes: 18 additions & 0 deletions dear-diary/firebase.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"hosting": {
"site": "dear-diary-thambara",
"public": "build",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}

]
}
}
Binary file removed dear-diary/public/background.png
Binary file not shown.
Binary file removed dear-diary/public/logo.png
Binary file not shown.
13 changes: 0 additions & 13 deletions dear-diary/public/user-avatar.svg

This file was deleted.

2 changes: 1 addition & 1 deletion dear-diary/src/components/DearDiary/DearDiary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const SignInPageTitle = styled.div`
const DearDiary = () => {
return (
<SignInPageHeaderBackground >
<SignInPageLogo src={"/logo.png"} alt="logo" />
<SignInPageLogo src={"https://res.cloudinary.com/dzsokhvfq/image/upload/v1703007756/jvxeozqwb43syppmtayv.png"} alt="logo" />
<SignInPageTitle >Dear Diary</SignInPageTitle>
</SignInPageHeaderBackground>
);
Expand Down
2 changes: 1 addition & 1 deletion dear-diary/src/components/Profile/Profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const Profile = () => {
return (
<ProfileWrapper>
<ProfileName>
<ImageProfile src={"/user-avatar.svg"}></ImageProfile>
<ImageProfile src={"https://res.cloudinary.com/dzsokhvfq/image/upload/v1703007607/vpgx1dyoefgkgebbbrrs.svg"}></ImageProfile>
<ProfileNameText >
{name}
</ProfileNameText>
Expand Down
13 changes: 9 additions & 4 deletions dear-diary/src/containers/HomePage/Home/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,23 @@ const HomeSearch = styled.div`
flex-direction: row;
justify-content: space-between;
align-items: center;
width: 100%;
`
width: 100%;`;

const ScrollableGridContainer = styled.div`
overflow-y: auto;
`
const SubmitFormButton = styled(Button)`
border: 0.1px solid black !important;
min-width: 16vh !important;
width : 12% ;
color: white !important;
box-shadow: 0px 4px 4px 0px rgba(50, 50, 50, 0.638);
background-color: #0092DD !important;
text-transform: none !important;`
text-transform: none !important;

@media screen and (max-width: 1000px) {
min-width :24vh !important;
}`


type HomeProps = {
showform: boolean;
Expand Down
2 changes: 1 addition & 1 deletion dear-diary/src/containers/HomePage/HomePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const Background = styled.div`
display: flex;
width: 100%;
min-height: 100vh;
background-image: url("/background.png");
background-image: url("https://res.cloudinary.com/dzsokhvfq/image/upload/v1703006709/dhbvxtisextdrc9odln0.png");
background-size: cover;
background-repeat: no-repeat;
padding-bottom: 0;
Expand Down
134 changes: 67 additions & 67 deletions dear-diary/src/containers/HomePage/SubmitForm/SubmitForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ import { useAppDispatch } from '../../../redux/hooks';
import { addCardByUser } from '../../../redux/diarycard/diaryCardSlice';

type Diary = {
title: string;
body: string;
title: string;
body: string;
};

type SubmitFormProps = {
showform: boolean;
reset: () => void;
showform: boolean;
reset: () => void;
};

const StyledSubmitForm = styled.div<{ showform: boolean }>`
Expand Down Expand Up @@ -87,72 +87,72 @@ const TextFieldSingleLine = styled(TextField)`
width: 99%;`

const TextFieldMultiLine = styled(TextField)`
width: 95%;`
width: 95%;`

const SubmitForm: React.FC<SubmitFormProps> = ({ showform, reset }) => {
const [title, setTitle] = useState('');
const [description, setDescription] = useState('');
const dispatch = useAppDispatch();

const handleTitleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
setTitle(event.target.value);
};

const handleDescriptionChange = (event: React.ChangeEvent<HTMLTextAreaElement>) => {
setDescription(event.target.value);
};

const handleSubmit = () => {
const newDiary: Diary = {
title: title,
body: description,
const [title, setTitle] = useState('');
const [description, setDescription] = useState('');
const dispatch = useAppDispatch();

const handleTitleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
setTitle(event.target.value);
};

const handleDescriptionChange = (event: React.ChangeEvent<HTMLTextAreaElement>) => {
setDescription(event.target.value);
};

const handleSubmit = () => {
const newDiary: Diary = {
title: title,
body: description,
};
if (!ValidateDiaryCard(title, description)) {
return;
}
dispatch(addCardByUser(newDiary));
setTitle('');
setDescription('');
reset();
};
if (!ValidateDiaryCard(title, description)) {
return;
}
dispatch(addCardByUser(newDiary));
setTitle('');
setDescription('');
reset();
};

const handleCancel = () => {
setTitle('');
setDescription('');
};

const handleClose = () => {
setTitle('');
setDescription('');
reset();
};

return (
<StyledSubmitForm showform={showform}>
<HeaderSubmit>
<FormTitle>Submit New</FormTitle>
<FormClose onClick={handleClose}>
<CloseIcon />
</FormClose>
</HeaderSubmit>
<SubmitTitle>
<SubmitFormBar>Title</SubmitFormBar>
<TextFieldSingleLine value={title} onChange={handleTitleChange} placeholder="Enter title" size="small" />
</SubmitTitle>
<SubmitDesc>
<SubmitFormBar>Description</SubmitFormBar>
<TextFieldMultiLine value={description} onChange={handleDescriptionChange} placeholder="Descryption" multiline rows={10} />
</SubmitDesc>
<div>
<SubmitButton variant="contained" onClick={handleSubmit}>
Submit
</SubmitButton>
<CancelButton variant="contained" onClick={handleCancel}>
Cancel
</CancelButton>
</div>
</StyledSubmitForm>
);

const handleCancel = () => {
setTitle('');
setDescription('');
};

const handleClose = () => {
setTitle('');
setDescription('');
reset();
};

return (
<StyledSubmitForm showform={showform}>
<HeaderSubmit>
<FormTitle>Submit New</FormTitle>
<FormClose onClick={handleClose}>
<CloseIcon />
</FormClose>
</HeaderSubmit>
<SubmitTitle>
<SubmitFormBar>Title</SubmitFormBar>
<TextFieldSingleLine value={title} onChange={handleTitleChange} placeholder="Enter title" size="small" />
</SubmitTitle>
<SubmitDesc>
<SubmitFormBar>Description</SubmitFormBar>
<TextFieldMultiLine value={description} onChange={handleDescriptionChange} placeholder="Descryption" multiline rows={10} />
</SubmitDesc>
<div>
<SubmitButton variant="contained" onClick={handleSubmit}>
Submit
</SubmitButton>
<CancelButton variant="contained" onClick={handleCancel}>
Cancel
</CancelButton>
</div>
</StyledSubmitForm>
);
};

export default SubmitForm;
2 changes: 1 addition & 1 deletion dear-diary/src/containers/SignInPage/SignInPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const Background = styled.div`
display: flex;
width: 100%;
min-height: 100vh;
background-image: url("/background.png");
background-image: url("https://res.cloudinary.com/dzsokhvfq/image/upload/v1703006709/dhbvxtisextdrc9odln0.png");
background-size: cover;
background-repeat: no-repeat;
padding-bottom: 0;
Expand Down
2 changes: 1 addition & 1 deletion dear-diary/src/redux/diarycard/diaryCardSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const diaryCardSlice = createSlice({
state.cards = action.payload;
},
watchingCards: (state) => {
state.isLoading = false;

}


Expand Down