Skip to content

Commit

Permalink
feat::package: package updates
Browse files Browse the repository at this point in the history
  • Loading branch information
doniaskima committed Oct 8, 2023
1 parent 9c2e261 commit 8713af4
Show file tree
Hide file tree
Showing 7 changed files with 102 additions and 9 deletions.
8 changes: 4 additions & 4 deletions exemple/package-lock.json

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

2 changes: 1 addition & 1 deletion exemple/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"dependencies": {
"react": "^18.2.0",
"react-craftify-core": "^0.0.16",
"react-craftify-core": "^0.0.17",
"react-dom": "^18.2.0",
"react-router-dom": "^6.16.0"
},
Expand Down
16 changes: 13 additions & 3 deletions exemple/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,20 @@ import Modalss from './components/Modals'
import Drawers from './components/Drawers'
import Tables from './components/Tables'
import Statistics from './components/Statistics'
import Navbar from './components/Navbar'
import Menus from './components/Menus'

function App() {
return (
<>
{/* <Navbar>
Heyy I have
Heyy I have <br/>
Heyy I have <br/>
Heyy I have <br/>
<br/>
Heyy I have
</Navbar> */}
{/* <ArticleCards/>
<CardComponent/> */
}
Expand All @@ -18,11 +28,11 @@ function App() {
{/* <div style={{ margin: "8rem 0" }}>
<Tables />
</div> */}

{/*
<div style={{ margin: "8rem 0" }}>
<Statistics />
</div>

</div> */}
{/* <Menus/> */}
</>
)
}
Expand Down
59 changes: 59 additions & 0 deletions exemple/src/components/Menus/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import React, { useState, useEffect } from "react";
import { Card, Container, Menu } from "react-craftify-core";
import { Link } from "react-router-dom";


const Menus = () => {
const [selectedItem, setSelectedItem] = useState(window.location.pathname.split("/")[1]);

useEffect(() => {
if (location !== prevLocation) {
// Get the right selected item for the actual path
setSelectedItem(window.location.pathname.split("/")[1]);
}
}, [location]);

return (
<Container>
<Card>
<div className="componentBlock">
<h3 className="componentTitle">Menu</h3>
<p className="componentDescr">Simple menu</p>

<Card style={{ padding: 0 }}>
<Menu
style={{ width: 250, padding: "1.2rem 0" }}
selectedItem={selectedItem}
>
<Menu.Item uniqueKey="">
<Link to="/">Menu item 1</Link>
</Menu.Item>

<Menu.Item uniqueKey="2">
<Link to="/2">Menu item 2</Link>
</Menu.Item>

<Menu.Item uniqueKey="3">
<Link to="/3">Menu item 3</Link>
</Menu.Item>

<Menu.Item uniqueKey="4">
<Link to="/4">Menu item 4</Link>
</Menu.Item>

<Menu.Item uniqueKey="5">
<Link to="/5">Menu item 5</Link>
</Menu.Item>

<Menu.Item uniqueKey="6">
<button>Menu item 6</button>
</Menu.Item>
</Menu>
</Card>
</div>
</Card>
</Container>
);
};

export default Menus;
7 changes: 7 additions & 0 deletions exemple/src/components/Navbar/Navbar.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.navbar {
background: #fff;
box-shadow: 0 2px 8px #f0f1f2;
position: relative;
z-index: 10;
max-width: 100%;
}
17 changes: 17 additions & 0 deletions exemple/src/components/Navbar/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React from 'react';
import PropTypes from 'prop-types';
import './NavBar.css';

const Navbar = ({ children }) => {
return (
<div className="navbar">
{children}
</div>
);
};

Navbar.propTypes = {
children: PropTypes.node.isRequired,
};

export default Navbar;
2 changes: 1 addition & 1 deletion packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "react-craftify-core",
"version": "0.0.17",
"description": "React-craftify is a versatile React component library designed to enhance the user interface of your web applications. With a focus on aesthetics and usability, React-craftify provides a collection of customizable UI components that can seamlessly integrate into your projects. ",
"main": "dist/cjs/index.js",
"main": "dist/index.js",
"module": "dist/esm/index.js",
"types": "dist/index.d.ts",
"scripts": {
Expand Down

0 comments on commit 8713af4

Please sign in to comment.