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
commit d719e38531
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 7 deletions

View File

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

View File

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

View File

@ -4,7 +4,7 @@ const config = {
github: {
username: 'arifszn', // Your GitHub org/user name. (Required)
sortBy: 'stars', // stars | updated
limit: 8, // How many projects to display.
limit: 10, // How many projects to display.
exclude: {
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']