~kameliya/tori

d002b3c62db5c3c3169a7c5022291030f6cbada3 — Ashe Connor 1 year, 8 months ago 440dd16
link
2 files changed, 20 insertions(+), 3 deletions(-)

M frontend/src/Mutes.css
M frontend/src/Mutes.tsx
M frontend/src/Mutes.css => frontend/src/Mutes.css +7 -1
@@ 2,6 2,8 @@
    padding: 2em;
}

/* heading */

.Mutes .heading {    
    color: var(--primary1bright);
}


@@ 10,6 12,8 @@
    color: white;
}

/* mute input */

.Mutes .doMute {
    margin: 1.7ex 0 1ex;
    vertical-align: middle;


@@ 43,6 47,8 @@
    margin-left: 1ex;
}

/* table */

.Mutes table {
    margin: 1em 0 0 0;



@@ 76,7 82,7 @@
    padding-bottom: 1em;
}

.Mutes .screenName {
.Mutes .screenName a {
    font-weight: bold;

    color: var(--complement1);

M frontend/src/Mutes.tsx => frontend/src/Mutes.tsx +13 -2
@@ 75,7 75,7 @@ class Mutes extends React.Component<MutesProps, MutesState> {
    return mutes.map((m, i) => {
      return (<tr key={m.id}>
        <td className="screenName">
          @{m.screenName}
          <a href={`https://twitter.com/${m.screenName}`}>@{m.screenName}</a>
        </td>
        <td className="created">
          {formatFunc(new Date(m.created))}


@@ 156,8 156,19 @@ class Mutes extends React.Component<MutesProps, MutesState> {
      return;
    }

    let mutes = this.state.mutes.concat(mute);
    mutes.sort((a, b) => { 
      const aLower = a.screenName.toLowerCase();
      const bLower = b.screenName.toLowerCase();
      if (aLower < bLower)
        return -1;
      if (aLower > bLower)
        return 1;
      return 0;
    });

    this.setState({ 
      mutes: this.state.mutes.concat(mute),
      mutes,
      submitting: false,
      muteScreenName: '',
    });