Skip to content

Commit

Permalink
pull in react icons
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Roggo committed Jun 23, 2024
1 parent 164943c commit 330a700
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 29 deletions.
2 changes: 2 additions & 0 deletions app/.meteor/packages
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@ standard-minifier-js@2.8.1 # JS minifier run for production mode
es5-shim@4.8.0 # ECMAScript 5 compatibility for older browsers
ecmascript@0.16.8 # Enable ECMAScript2015+ syntax in app code
shell-server@0.5.0 # Server-side component of the `meteor shell` command
hot-module-replacement@0.5.3 # Update client in development without reloading the page

insecure@1.0.7 # Allow all DB writes from clients (for prototyping)
react-meteor-data@2.0.1
less@2.8.0

static-html@1.3.2
underscore@1.6.0
accounts-password@2.4.0
Expand Down
12 changes: 7 additions & 5 deletions app/.meteor/versions
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ babel-compiler@7.10.5
babel-runtime@1.5.1
base64@1.0.12
binary-heap@1.0.11
blaze-tools@1.1.2
blaze-tools@1.1.3
boilerplate-generator@1.7.2
caching-compiler@1.2.2
caching-html-compiler@1.2.1
Expand All @@ -29,8 +29,9 @@ es5-shim@4.8.0
fetch@0.1.4
geojson-utils@1.0.11
hot-code-push@1.0.4
html-tools@1.1.2
htmljs@1.1.0
hot-module-replacement@0.5.3
html-tools@1.1.3
htmljs@1.1.1
id-map@1.1.1
insecure@1.0.7
inter-process-messaging@0.1.1
Expand All @@ -48,6 +49,7 @@ mobile-status-bar@1.1.0
modern-browsers@0.1.10
modules@0.20.0
modules-runtime@0.13.1
modules-runtime-hot@0.14.2
mongo@1.16.8
mongo-decimal@0.1.3
mongo-dev-server@1.1.0
Expand All @@ -69,10 +71,10 @@ service-configuration@1.3.3
sha@1.0.9
shell-server@0.5.0
socket-stream-client@0.5.2
spacebars-compiler@1.3.0
spacebars-compiler@1.3.1
standard-minifier-js@2.8.1
static-html@1.3.2
templating-tools@1.2.1
templating-tools@1.2.2
tracker@1.3.3
typescript@4.9.5
underscore@1.6.0
Expand Down
4 changes: 2 additions & 2 deletions app/client/fret.less
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ svg.chord-diag {

text {
fill: var(--text-inverted);
font-weight: 500;
font-weight: 700;
}
}

Expand All @@ -43,7 +43,7 @@ svg.chord-diag {

text {
fill: var(--text-inverted);
font-weight: 500;
font-weight: 700;
}

&.open circle, &.muted line {
Expand Down
5 changes: 5 additions & 0 deletions app/client/icons.less
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,8 @@ svg {
fill: var(--gray-light);
}
}

svg path[fill="none"] {
// protect Angular Material Icon's bounding boxes from switching color
stroke: transparent;
}
29 changes: 14 additions & 15 deletions app/imports/ui/List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import Drawer from './Drawer';
import {navigateTo, routePath, userMayWrite, View} from '../api/helpers';
import classNames from 'classnames';

import {MdFace, MdFavorite, MdFavoriteBorder, MdSell, MdStyle} from 'react-icons/md';

interface ListItemProps {
song: Song;
Expand Down Expand Up @@ -49,9 +50,12 @@ class ListItem extends React.Component<ListItemProps> {

const darlings = u?.profile?.darlings ?? [];

const is_darling = darlings.includes(this.props.song._id) ? 'is_darling' : '';
const is_darling = darlings.includes(this.props.song._id);

const darling_or_not = u ? <span onClick={this.toggleDarling} className={'darling ' + is_darling}>{darling_icon}</span> : undefined;
const toggler = is_darling ?
<span onClick={this.toggleDarling} className='darling is_darling'><MdFavorite/></span> :
<span onClick={this.toggleDarling} className='darling'><MdFavoriteBorder/></span>
const darling_or_not = u ? toggler : undefined;

return (
<li><NavLink onClick={this.props.onClickHandler} to={routePath(View.view, this.props.song)}
Expand All @@ -65,12 +69,6 @@ class ListItem extends React.Component<ListItemProps> {
}
}

const darling_icon = (
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
<circle cx="12" cy="12" r="10"/>
</svg>
);

interface ListGroupProps {
songs: Array<Song>;
user: Meteor.User;
Expand Down Expand Up @@ -252,13 +250,13 @@ class List extends React.Component<ListProps & RouteComponentProps, ListState> {
};

onTagClick = (event : React.MouseEvent) => {
const tag = '#' + event.currentTarget.childNodes[0].textContent.toLowerCase();
const tag = ' #' + event.currentTarget.childNodes[0].textContent.toLowerCase();

let newFilter;
if (this.state.filter.includes(tag)) {
newFilter = this.state.filter.replace(tag, '');
} else {
newFilter = this.state.filter + tag + ' ';
newFilter = this.state.filter + tag;
}
this.setFilter(newFilter.replace(' ', ' ').trim());

Expand Down Expand Up @@ -348,9 +346,8 @@ class List extends React.Component<ListProps & RouteComponentProps, ListState> {
<span className={'reset ' + filled} onClick={() => {
this.setFilter('');
}}>&times;</span>
<span className="open-tags" onClick={this.toggleTagsOpen}>Tags</span>
<span className="open-tags" onClick={this.toggleTagsOpen}><MdSell /></span>
</div>

<MetaContent
replace={process_filtermenu()}
className={classNames('filterMenu',
Expand All @@ -362,14 +359,16 @@ class List extends React.Component<ListProps & RouteComponentProps, ListState> {
songs={this.props.songs}
/>
<ul>
<h2>aabb</h2>
{Array.from(groups, ([group, songs]) => {
return <ListGroup user={this.props.user} label={group} songs={songs} key={group}
onClickHandler={this.props.hideOnMobile}/>;
}
return <ListGroup user={this.props.user} label={group} songs={songs} key={group}
onClickHandler={this.props.hideOnMobile}/>;
}
)}
{addSong}
</ul>
{userLink}
<MdFace />
</Drawer>
);
}
Expand Down
4 changes: 2 additions & 2 deletions app/imports/ui/MobileMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {ReactElementLike} from 'prop-types';
import * as React from 'react';
import {FC, MouseEventHandler, useRef} from 'react';
import {useScrollHideEffectRef} from '../api/helpers';
import {Menu} from './Icons.jsx';
import { MdManageSearch } from 'react-icons/md';


import './mobileMenuStyle.less';
Expand All @@ -29,7 +29,7 @@ export const MobileMenu: FC<MobileMenuProps> = (p) => {
useScrollHideEffectRef(ref, 64);

return <div className={classes} ref={ref}>
<span onClick={toggle} id="menu"><Menu /></span>
<span onClick={toggle} id="menu"><MdManageSearch /></span>
</div>;
};

Expand Down
15 changes: 12 additions & 3 deletions app/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 app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"name": "rechords",
"private": true,
"scripts": {
"//": "0:xx enables to access the the dev server from another computer",
"start": "meteor --settings settings.json --exclude-archs web.browser.legacy --port 0:3000",
"startAdvanced": "meteor --settings settings.advanced.json --exclude-archs web.browser.legacy --port 0:3000",
"debug": "meteor run --inspect",
Expand Down Expand Up @@ -34,6 +33,7 @@
"react-document-title": "^2.0.3",
"react-dom": "18.2.0",
"react-error-boundary": "^3.1.3",
"react-icons": "^5.2.1",
"react-redux": "^8.0.5",
"react-responsive": "^9.0.2",
"react-router-dom": "^5.1.1",
Expand Down
2 changes: 1 addition & 1 deletion app/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@
"core-js",
"mocha"
],
"jsx": "react"
"jsx": "react",
}
}

0 comments on commit 330a700

Please sign in to comment.