Skip to content

Commit

Permalink
feat: add emojis support
Browse files Browse the repository at this point in the history
  • Loading branch information
filippofinke authored and svedova committed Feb 25, 2022
1 parent 4afd147 commit d7eae77
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { useRef } from "react";
import { emojify } from "node-emoji";
import PropTypes from "prop-types";
import cn from "classnames";
import RootContext from "~/pages/Root.context";
Expand Down Expand Up @@ -41,7 +42,7 @@ const Deployment = ({ api, app, match }) => {
<div className="flex items-center mb-8">
<ExitStatus code={deploy.exit} iconOnly className="text-2xl mr-4" />
<div>
<div className="text-lg font-bold">{commit.msg}</div>
<div className="text-lg font-bold">{typeof commit.msg === "string" ? emojify(commit.msg) : commit.msg}</div>
{commit.author && <div>by {commit.author}</div>}
</div>
</div>
Expand Down
5 changes: 5 additions & 0 deletions src/pages/apps/[id]/deployments/_components/CommitInfo.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from "react";
import { emojify } from "node-emoji";
import Link from "~/components/Link";
import { parseCommit } from "~/utils/helpers/deployments";
import type { Commit } from "~/utils/helpers/deployments";
Expand All @@ -20,6 +21,10 @@ const CommitMessage: React.FC<CommitMessageProps> = ({
}): React.ReactElement => {
const isPublished = deployment.published?.length > 0;

if(typeof commit.msg === "string") {
commit.msg = emojify(commit.msg);
}

// No need to shorten if it's not published
if (!isPublished) {
return <span>{commit.msg}</span>;
Expand Down

0 comments on commit d7eae77

Please sign in to comment.