Skip to content

Commit

Permalink
added some feature
Browse files Browse the repository at this point in the history
  • Loading branch information
HEGADE committed Jun 21, 2021
1 parent 79e2293 commit a6e5742
Show file tree
Hide file tree
Showing 15 changed files with 198 additions and 110 deletions.
67 changes: 67 additions & 0 deletions package-lock.json

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

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"private": true,
"dependencies": {
"@material-ui/core": "^4.11.4",
"@material-ui/icons": "^4.11.2",
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
Expand All @@ -12,6 +13,7 @@
"react-dom": "^17.0.2",
"react-query": "^3.16.0",
"react-router": "^5.2.0",
"react-router-dom": "^5.2.0",
"react-scripts": "4.0.3",
"web-vitals": "^1.0.1"
},
Expand Down
12 changes: 7 additions & 5 deletions src/assets/css/article.css

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

2 changes: 1 addition & 1 deletion src/assets/css/article.css.map

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

7 changes: 5 additions & 2 deletions src/assets/css/article.scss
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,14 @@ a {
display: flex;
justify-content: space-between;
.author {
border-radius: 1000px;

margin-top: 1rem;
border-radius: 0.1rem;
font-size: small;
margin-left: 1rem;
padding: 0.2rem 0.4rem;
padding: 0.4rem 0.6rem;
background: rgba(0, 0, 0, 0.4);
color: rgba(255, 255, 255, 0.3);
}
.shareButton {
margin-top: 1rem;
Expand Down
22 changes: 11 additions & 11 deletions src/assets/css/global.css

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

14 changes: 7 additions & 7 deletions src/assets/css/readmore.css

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

3 changes: 2 additions & 1 deletion src/commomComponets/Heading.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from "react";

const Heading = () => {
const Heading = ({title}) => {
document.title = title
return (
<>
<div className="heading_arico">
Expand Down
11 changes: 6 additions & 5 deletions src/components/Article.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from "react";
import { Link } from "react-router-dom";
import ShareOutlinedIcon from '@material-ui/icons/ShareOutlined';

const Article = ({
img,
Expand All @@ -13,7 +14,7 @@ const Article = ({
background: `linear-gradient(193deg, ${determineColor},22%, #304569)`,
};
const share = async (e) => {
if (e.target.className === "shareButton") {

if (navigator.canShare) {
navigator
.share({
Expand All @@ -29,12 +30,12 @@ const Article = ({
alert("sharing capability is not supported by this browser");
});
}
}

};

return (
<>
<div className="card_body" style={bg} onClick={share}>
<div className="card_body" style={bg}>
<Link to={`/${goto}`}>
<div className="card_image">
<img src="logo192.png" alt="article_image" />
Expand All @@ -48,8 +49,8 @@ const Article = ({
</Link>
<div className="author_share">
<small className="author">{user}</small>
<small className="shareButton" id={goto} title={heading}>
Share
<small className="shareButton" id={goto} title={heading} onClick={share}>
<ShareOutlinedIcon />
</small>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/helper/fetchData.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useState, useEffect } from "react";
export const fetchData = async () => {
let _token = LocalStorage.getItem();
config.headers["auth"] = _token;
let data = await axios.get("http://localhost:8000/api", config);
let data = await axios.get("http://localhost:8000/api?page=1", config);
if (data.data?.code === -1) {
console.log("not authorized");
}
Expand Down
Loading

0 comments on commit a6e5742

Please sign in to comment.