Merge pull request #40 from arifszn/issue-39

feat: make the project and blog items openable on right click action
This commit is contained in:
Ariful Alam
2022-03-20 18:12:38 +06:00
committed by GitHub
3 changed files with 13 additions and 7 deletions

View File

@@ -102,10 +102,13 @@ const Blog = ({ loading }) => {
return ( return (
articles && articles &&
articles.slice(0, config.blog.limit).map((article, index) => ( articles.slice(0, config.blog.limit).map((article, index) => (
<div <a
className="card shadow-lg compact bg-base-100 cursor-pointer" className="card shadow-lg compact bg-base-100 cursor-pointer"
key={index} key={index}
onClick={() => { href={article.link}
onClick={(e) => {
e.preventDefault();
try { try {
if (config.googleAnalytics?.id) { if (config.googleAnalytics?.id) {
ga.event({ ga.event({
@@ -164,7 +167,7 @@ const Blog = ({ loading }) => {
</div> </div>
</div> </div>
</div> </div>
</div> </a>
)) ))
); );
}; };

View File

@@ -53,10 +53,13 @@ const Project = ({ repo, loading }) => {
const renderProjects = () => { const renderProjects = () => {
return repo.map((item, index) => ( return repo.map((item, index) => (
<div <a
className="card shadow-lg compact bg-base-100 cursor-pointer" className="card shadow-lg compact bg-base-100 cursor-pointer"
href={item.html_url}
key={index} key={index}
onClick={() => { onClick={(e) => {
e.preventDefault();
try { try {
if (config.googleAnalytics?.id) { if (config.googleAnalytics?.id) {
ga.event({ ga.event({
@@ -119,7 +122,7 @@ const Project = ({ repo, loading }) => {
</div> </div>
</div> </div>
</div> </div>
</div> </a>
)); ));
}; };

View File

@@ -4,7 +4,7 @@ const config = {
github: { github: {
username: 'arifszn', // Your GitHub org/user name. (Required) username: 'arifszn', // Your GitHub org/user name. (Required)
sortBy: 'stars', // stars | updated sortBy: 'stars', // stars | updated
limit: 8, // How many projects to display. limit: 10, // How many projects to display.
exclude: { exclude: {
forks: false, // Forked projects will not be displayed if set to true. forks: false, // Forked projects will not be displayed if set to true.
projects: ['laravel-ecommerce'], // These projects will not be displayed. example: ['my-project1', 'my-project2'] projects: ['laravel-ecommerce'], // These projects will not be displayed. example: ['my-project1', 'my-project2']